extern "C" {
#include <grass/gis.h>
#include <grass/glocale.h>
}

#include "common.h"
#include "iwave.h"

#ifdef WIN32
#pragma warning(disable:4305)	/* disable warning about initialization of a float by a double */
#endif

/* Adding new band filters:
 * see README
 */


/*
  spectral band of meteosat
*/
void IWave::meteo()
{
    static const float sr[305] = {
	.00,    .00,    .00,    .01,    .01,    .01,    .02,
	.02,    .02,    .02,    .02,    .02,    .03,    .03,
	.04,    .04,    .04,    .05,    .05,    .05,    .06,
	.06,    .07,    .07,    .07,    .08,    .08,    .09,
	.09,    .10,    .10,    .10,    .11,    .11,    .12,
	.12,    .12,    .13,    .14,    .14,    .15,    .15,
	.16,    .16,    .17,    .17,    .18,    .18,    .19,
	.20,    .20,    .21,    .21,    .22,    .23,    .24,
	.24,    .25,    .26,    .27,    .28,    .28,    .29,
	.30,    .30,    .31,    .32,    .33,    .34,    .35,
	.35,    .36,    .37,    .38,    .39,    .40,    .40,
	.41,    .42,    .43,    .44,    .45,    .46,    .48,
	.49,    .50,    .51,    .52,    .53,    .55,    .56,
	.57,    .58,    .60,    .61,    .62,    .63,    .64,
	.65,    .65,    .66,    .67,    .67,    .68,    .69,
	.69,    .70,    .71,    .71,    .72,    .73,    .73,
	.74,    .76,    .77,    .78,    .78,    .79,    .80,
	.81,    .82,    .83,    .84,    .85,    .86,    .87,
	.88,    .89,    .89,    .91,    .92,    .93,    .94,
	.95,    .96,    .96,    .97,    .98,    .98,    .99,
	.99,    .99,    .99,   1.00,   1.00,   1.00,   1.00,
	1.00,   1.00,   1.00,   1.00,   1.00,   1.00,    .99,
	.99,    .99,    .99,    .98,    .98,    .98,    .98,
	.98,    .97,    .97,    .97,    .97,    .97,    .97,
	.97,    .96,    .96,    .96,    .96,    .96,    .96,
	.96,    .96,    .96,    .96,    .95,    .95,    .95,
	.94,    .93,    .93,    .92,    .92,    .91,    .90,
	.89,    .89,    .88,    .88,    .87,    .86,    .86,
	.85,    .85,    .84,    .84,    .83,    .82,    .82,
	.81,    .80,    .80,    .79,    .79,    .78,    .77,
	.77,    .76,    .76,    .75,    .75,    .74,    .74,
	.74,    .73,    .73,    .72,    .71,    .70,    .68,
	.67,    .65,    .64,    .63,    .62,    .61,    .60,
	.59,    .58,    .57,    .56,    .55,    .54,    .53,
	.52,    .51,    .50,    .49,    .49,    .48,    .47,
	.46,    .45,    .43,    .42,    .41,    .40,    .39,
	.38,    .37,    .36,    .35,    .34,    .33,    .31,
	.30,    .29,    .28,    .28,    .27,    .25,    .24,
	.23,    .22,    .21,    .20,    .19,    .18,    .17,
	.16,    .15,    .14,    .13,    .12,    .11,    .11,
	.10,    .09,    .08,    .08,    .08,    .07,    .06,
	.06,    .05,    .05,    .05,    .04,    .04,    .03,
	.03,    .02,    .02,    .01,    .01,    .01,    .01,
	.01,    .00,    .00,    .00 };


    ffu.wlinf=0.3499999f;
    ffu.wlsup=1.11f;

    int i;
    for(i = 0; i < 40; i++)	ffu.s[0] = 0;
    for(i = 0; i < 305; i++)	ffu.s[40+i] = sr[i];
    for(i = 345; i < 1501; i++) ffu.s[i] = 0;
}


void IWave::goes_east()
{
    /* spectral band of goes east */
    static const float sr[165] = {
	.00,    .00,    .00,    .01,    .01,    .03,    .05,
	.09,    .13,    .22,    .30,    .38,    .46,    .52,
	.58,    .63,    .68,    .70,    .73,    .75,    .77,
	.79,    .81,    .82,    .84,    .85,    .86,    .87,
	.88,    .89,    .90,    .91,    .92,    .93,    .93,
	.94,    .95,    .96,    .96,    .97,    .98,    .99,
	.99,    .99,    .98,    .98,    .97,    .97,    .96,
	.95,    .95,    .94,    .94,    .93,    .93,    .92,
	.92,    .91,    .91,    .91,    .91,    .91,    .91,
	.91,    .91,    .91,    .91,    .90,    .89,    .88,
	.88,    .86,    .84,    .83,    .81,    .79,    .77,
	.75,    .73,    .71,    .69,    .69,    .68,    .67,
	.66,    .65,    .64,    .63,    .61,    .60,    .59,
	.57,    .56,    .54,    .52,    .50,    .49,    .47,
	.46,    .44,    .43,    .41,    .40,    .38,    .36,
	.35,    .33,    .32,    .30,    .29,    .28,    .27,
	.26,    .25,    .23,    .22,    .21,    .20,    .19,
	.18,    .17,    .16,    .15,    .14,    .13,    .12,
	.11,    .10,    .10,    .09,    .08,    .08,    .07,
	.06,    .06,    .05,    .05,    .04,    .04,    .03,
	.03,    .03,    .02,    .02,    .02,    .02,    .01,
	.01,    .01,    .01,    .01,    .00,    .00,    .00,
	.00,    .00,    .00,    .00,    .00,    .00,    .00,
	.00,    .00,    .00,    .00 };

    ffu.wlinf = 0.49f;
    ffu.wlsup = 0.8999999f;
    int i = 0;
    for(i = 0; i < 96; i++)	ffu.s[i] = 0;
    for(i = 0; i < 165; i++)	ffu.s[96+i] = sr[i];
    for(i = 261; i < 1501; i++) ffu.s[i] = 0;
}

void IWave::goes_west()
{
    /* spectral band of goes west */
	
    static const float sr[165] = {
	.00,    .00,    .00,    .00,    .00,    .01,    .02,
	.04,    .06,    .12,    .18,    .30,    .41,    .51,
	.61,    .69,    .77,    .83,    .89,    .91,    .93,
	.94,    .96,    .96,    .97,    .98,    .99,    .99,
	.99,   1.00,   1.00,   1.00,   1.00,   1.00,   1.00,
	.99,    .99,    .99,    .98,    .98,    .97,    .97,
	.96,    .96,    .96,    .95,    .95,    .95,    .94,
	.94,    .93,    .92,    .91,    .90,    .89,    .88,
	.87,    .86,    .85,    .84,    .83,    .82,    .81,
	.80,    .80,    .79,    .78,    .77,    .76,    .75,
	.74,    .73,    .72,    .70,    .69,    .67,    .66,
	.64,    .63,    .61,    .59,    .58,    .56,    .55,
	.54,    .52,    .51,    .50,    .49,    .48,    .46,
	.45,    .44,    .43,    .41,    .40,    .38,    .37,
	.36,    .34,    .33,    .32,    .31,    .29,    .28,
	.27,    .26,    .24,    .23,    .22,    .21,    .20,
	.19,    .18,    .17,    .17,    .16,    .15,    .14,
	.14,    .13,    .12,    .12,    .11,    .10,    .09,
	.09,    .08,    .08,    .07,    .07,    .07,    .06,
	.06,    .05,    .05,    .05,    .04,    .04,    .03,
	.03,    .03,    .03,    .02,    .02,    .02,    .02,
	.02,    .01,    .01,    .01,    .01,    .01,    .01,
	.01,    .00,    .00,    .00,    .00,    .00,    .00,
	.00,    .00,    .00,    .00 };

    ffu.wlinf = 0.49f;
    ffu.wlsup = 0.8999999f;
    int i = 0;
    for(i = 0; i < 96; i++)	ffu.s[i] = 0;
    for(i = 0; i < 165; i++)	ffu.s[96+i] = sr[i];
    for(i = 261; i < 1501; i++) ffu.s[i] = 0;
}

void IWave::avhrr(int iwa)
{
    /* 1st spectral band of avhrr  (noaa 6) */
    static const float sr1[80] = {
	.0000, .0178, .0355, .0533, .0710, .1655, .2600, .3545,
	.4490, .5215, .5940, .6665, .7390, .7575, .7760, .7945,
	.8130, .8113, .8095, .8078, .8060, .8201, .8343, .8484,
	.8625, .8766, .8908, .9049, .9190, .9291, .9393, .9494,
	.9595, .9696, .9798, .9899, 1.000, .9996, .9992, .9989,
	.9985, .9981, .9977, .9974, .9970, .9596, .9222, .8849,
	.8475, .8101, .7727, .7354, .6980, .6047, .5115, .4182,
	.3250, .2767, .2285, .1802, .1320, .1127, .0935, .0742,
	.0550, .0480, .0410, .0340, .0270, .0235, .0200, .0165,
	.0130, .0115, .0100, .0085, .0070, .0052, .0035, .0017
    };

    /* 2nd spectral band of avhrr  (noaa 6) */
    static const float sr2[173] = {

	.0000, .0020, .0040, .0060, .0080, .0710, .1340, .1970,
	.2600, .3492, .4385, .5277, .6170, .6678, .7185, .7693,
	.8200, .8435, .8670, .8905, .9140, .9212, .9285, .9358,
	.9430, .9415, .9400, .9385, .9370, .9520, .9670, .9820,
	.9970, .9977, .9985, .9992, 1.000, .9813, .9625, .9438,
	.9250, .9148, .9045, .8943, .8840, .8751, .8663, .8574,
	.8485, .8396, .8307, .8219, .8130, .8100, .8070, .8040,
	.8010, .7980, .7950, .7920, .7890, .7878, .7865, .7853,
	.7840, .7828, .7815, .7803, .7790, .7751, .7713, .7674,
	.7635, .7596, .7558, .7519, .7480, .7464, .7448, .7431,
	.7415, .7399, .7383, .7366, .7350, .7225, .7100, .6975,
	.6850, .6783, .6715, .6648, .6580, .6515, .6450, .6385,
	.6320, .6270, .6220, .6170, .6120, .6093, .6065, .6038,
	.6010, .5993, .5975, .5958, .5940, .5910, .5880, .5850,
	.5820, .5720, .5620, .5520, .5420, .5243, .5065, .4887,
	.4710, .4402, .4095, .3787, .3480, .3155, .2830, .2505,
	.2180, .1935, .1690, .1445, .1200, .1055, .0910, .0765,
	.0620, .0540, .0460, .0380, .0300, .0257, .0215, .0172,
	.0130, .0112, .0095, .0077, .0060, .0053, .0045, .0038,
	.0030, .0025, .0020, .0015, .0010, .0010, .0010, .0010,
	.0010, .0009, .0007, .0006, .0005, .0004, .0004, .0003,
	.0002, .0002, .0001, .0001, .0000 
    };


    /* 1st spectral band of avhrr (noaa 7) */
    static const float sr3[121] = {
	.0000, .0008, .0016, .0024, .0032, .0032, .0031, .0030,
	.0030, .0029, .0029, .0028, .0028, .0027, .0027, .0026,
	.0025, .0031, .0036, .0042, .0047, .0288, .0529, .0769,
	.1010, .1943, .2875, .3808, .4740, .5363, .5985, .6608,
	.7230, .7390, .7550, .7710, .7870, .7838, .7805, .7773,
	.7740, .7788, .7835, .7883, .7930, .8100, .8270, .8440,
	.8610, .8958, .9305, .9653,1.0000, .9860, .9720, .9580,
	.9440, .9435, .9430, .9425, .9420, .9442, .9465, .9487,
	.9510, .9575, .9640, .9705, .9770, .9135, .8500, .7865,
	.7230, .6285, .5340, .4395, .3450, .2955, .2460, .1965,
	.1470, .1280, .1090, .0900, .0710, .0638, .0565, .0493,
	.0420, .0383, .0345, .0307, .0270, .0245, .0220, .0195,
	.0170, .0158, .0145, .0132, .0120, .0114, .0107, .0101,
	.0095, .0096, .0098, .0099, .0100, .0103, .0105, .0108,
	.0110, .0100, .0090, .0080, .0070, .0052, .0035, .0017,
	.0000 
    };

    /* 2nd spectral band of avhrr  (noaa 7) */
    static const float sr4[213] = {
	.0000, .0018, .0035, .0053, .0070, .0068, .0065, .0063,
	.0060, .0058, .0055, .0052, .0050, .0050, .0050, .0050,
	.0050, .0060, .0070, .0080, .0090, .0320, .0550, .0780,
	.1010, .1788, .2565, .3343, .4120, .4922, .5725, .6527,
	.7330, .7765, .8200, .8635, .9070, .9218, .9365, .9513,
	.9660, .9725, .9790, .9855, .9920, .9940, .9960, .9980,
	1.0000, .9962,.9925, .9887, .9850, .9870, .9890, .9910,
	.9930, .9763, .9595, .9428, .9260, .9298, .9335, .9373,
	.9410, .9373, .9335, .9298, .9260, .9120, .8980, .8840,
	.8700, .8700, .8700, .8700, .8700, .8703, .8705, .8708,
	.8710, .8708, .8705, .8703, .8700, .8715, .8730, .8745,
	.8760, .8740, .8720, .8700, .8680, .8690, .8700, .8710,
	.8720, .8687, .8655, .8623, .8590, .8555, .8520, .8485,
	.8450, .8428, .8405, .8383, .8360, .8328, .8295, .8263,
	.8230, .8145, .8060, .7975, .7890, .7872, .7855, .7838,
	.7820, .7790, .7760, .7730, .7700, .7682, .7665, .7648,
	.7630, .7545, .7460, .7375, .7290, .6987, .6685, .6382,
	.6080, .5623, .5165, .4707, .4250, .3812, .3375, .2937/
	.2500, .2215, .1930, .1645, .1360, .1202, .1045, .0887,
	.0730, .0647, .0565, .0482, .0400, .0357, .0315, .0272,
	.0230, .0207, .0185, .0162, .0140, .0125, .0110, .0095,
	.0080, .0075, .0070, .0065, .0060, .0055, .0050, .0045,
	.0040, .0039, .0038, .0037, .0036, .0036, .0037, .0037,
	.0037, .0035, .0034, .0032, .0031, .0029, .0028, .0026,
	.0025, .0025, .0024, .0024, .0023, .0023, .0022, .0022,
	.0021, .0021, .0021, .0020, .0020, .0019, .0019, .0018,
	.0018, .0013, .0009, .0004, .0000 
    };

    /* 1st spectral band of avhrr (noaa 8) */
    static const float sr5[189] = {
	.0000, .0012, .0024, .0036, .0048, .0223, .0399, .0574,
	.0749, .1633, .2517, .3400, .4284, .4937, .5590, .6243,
	.6896, .7135, .7375, .7614, .7853, .7833, .7813, .7793,
	.7773, .7774, .7775, .7776, .7777, .7922, .8067, .8211,
	.8356, .8566, .8777, .8987, .9197, .9332, .9468, .9603,
	.9739, .9674, .9609, .9545, .9480, .9507, .9534, .9561,
	.9588, .9691, .9794, .9897,1.0000, .9692, .9385, .9077,
	.8770, .7775, .6779, .5784, .4789, .4108, .3428, .2747,
	.2067, .1782, .1497, .1213, .0928, .0820, .0712, .0604,
	.0496, .0425, .0355, .0284, .0214, .0208, .0202, .0196,
	.0190, .0167, .0145, .0122, .0100, .0095, .0090, .0085,
	.0080, .0083, .0086, .0089, .0092, .0094, .0097, .0100,
	.0103, .0100, .0096, .0093, .0090, .0086, .0083, .0079,
	.0076, .0082, .0087, .0093, .0099, .0104, .0110, .0115,
	.0121, .0114, .0108, .0101, .0094, .0088, .0081, .0075,
	.0068, .0074, .0079, .0085, .0091, .0097, .0102, .0108,
	.0114, .0115, .0115, .0116, .0117, .0118, .0119, .0119,
	.0120, .0136, .0152, .0167, .0183, .0204, .0224, .0245,
	.0265, .0295, .0324, .0354, .0384, .0419, .0453, .0488,
	.0522, .0514, .0507, .0499, .0491, .0467, .0443, .0420,
	.0396, .0348, .0299, .0251, .0203, .0183, .0164, .0144,
	.0125, .0118, .0110, .0103, .0095, .0083, .0071, .0060,
	.0048, .0041, .0035, .0028, .0022, .0022, .0021, .0021,
	.0021, .0016, .0010, .0005, .0000 
    };


    /*  2nd spectral band of avhrr  (noaa 8) */
    static const float sr6[177] = { 
	.0000, .0095, .0190, .0285, .0381, .0476, .0571, .0666,
	.0761, .1559, .2358, .3156, .3954, .4855, .5756, .6658,
	.7559, .7966, .8373, .8779, .9186, .9332, .9478, .9624,
	.9770, .9814, .9858, .9902, .9946, .9959, .9973, .9986,
	1.0000, .9965, .9930, .9896, .9861, .9796, .9731, .9666,
	.9601, .9518, .9435, .9351, .9268, .9171, .9073, .8976,
	.8879, .8791, .8703, .8615, .8527, .8439, .8351, .8263,
	.8175, .8140, .8104, .8068, .8033, .7997, .7962, .7926,
	.7891, .7871, .7850, .7830, .7810, .7790, .7769, .7749,
	.7729, .7711, .7694, .7677, .7659, .7642, .7624, .7607,
	.7589, .7558, .7528, .7497, .7466, .7436, .7405, .7375,
	.7344, .7282, .7220, .7158, .7096, .7034, .6972, .6910,
	.6848, .6781, .6713, .6646, .6579, .6511, .6444, .6376,
	.6309, .6265, .6221, .6177, .6133, .6088, .6044, .6000,
	.5956, .5888, .5820, .5752, .5684, .5616, .5548, .5480,
	.5412, .5159, .4906, .4653, .4400, .4147, .3894, .3641,
	.3388, .3061, .2734, .2408, .2081, .1851, .1621, .1392,
	.1162, .1023, .0884, .0745, .0606, .0532, .0458, .0384/
	.0310, .0271, .0231, .0192, .0153, .0134, .0115, .0096,
	.0077, .0071, .0065, .0059, .0053, .0046, .0040, .0034,
	.0028, .0026, .0024, .0023, .0021, .0019, .0017, .0016,
	.0014, .0012, .0010, .0009, .0007, .0005, .0003, .0002,
	.0000
    };

    /* 1st spectral band of avhrr (noaa 9) */
    static const float sr7[113] = {
	.0000, .0001, .0003, .0004, .0006, .0040, .0074, .0108,
	.0142, .0622, .1101, .1581, .2060, .2810, .3561, .4311,
	.5061, .5500, .5940, .6379, .6818, .7127, .7437, .7746,
	.8055, .8122, .8190, .8170, .8150, .8063, .7975, .7887,
	.7800, .7881, .7962, .8044, .8125, .8335, .8544, .8753,
	.8963, .9000, .9037, .9074, .9111, .8899, .8688, .8476,
	.8265, .8198, .8130, .8110, .8090, .8277, .8464, .8650,
	.8837, .9128, .9419, .9709,1.0000, .9678, .9356, .9035,
	.8713, .7712, .6711, .5711, .4710, .4067, .3424, .2782,
	.2139, .1849, .1559, .1269, .0979, .0861, .0743, .0625,
	.0507, .0454, .0400, .0347, .0294, .0266, .0238, .0210,
	.0182, .0170, .0157, .0145, .0133, .0124, .0115, .0107,
	.0098, .0092, .0086, .0080, .0074, .0071, .0069, .0066,
	.0063, .0062, .0061, .0061, .0060, .0045, .0030, .0015,
	.0000
    };

    /* 2nd spectral band of avhrr  (noaa 9) */
    static const float sr8[197] = {
	.0000, .0011, .0022, .0033, .0044, .0207, .0369, .0532,
	.0694, .1410, .2127, .2843, .3559, .4388, .5217, .6047,
	.6876, .7304, .7731, .8159, .8586, .8782, .8977, .9173,
	.9369, .9491, .9614, .9736, .9859, .9894, .9930, .9965,
	1.0000, .9956, .9912, .9869, .9825, .9699, .9574, .9448,
	.9323, .9243, .9163, .9083, .9003, .8971, .8939, .8907,
	.8875, .8881, .8887, .8893, .8899, .8931, .8963, .8994,
	.9026, .9046, .9067, .9087, .9108, .9114, .9120, .9126,
	.9132, .9065, .8997, .8930, .8863, .8807, .8750, .8694,
	.8638, .8605, .8571, .8538, .8504, .8532, .8560, .8588,
	.8616, .8644, .8672, .8701, .8729, .8749, .8770, .8790,
	.8811, .8766, .8721, .8677, .8632, .8502, .8372, .8242,
	.8112, .7959, .7806, .7653, .7500, .7423, .7347, .7270,
	.7193, .7166, .7138, .7111, .7084, .7169, .7255, .7340,
	.7425, .7382, .7338, .7295, .7251, .6819, .6387, .5955,
	.5523, .4922, .4321, .3721, .3120, .2722, .2325, .1927,
	.1529, .1336, .1144, .0951, .0759, .0673, .0586, .0500,
	.0414, .0370, .0327, .0283, .0240, .0217, .0195, .0172,
	.0150, .0139, .0128, .0118, .0107, .0099, .0090, .0082,
	.0074, .0070, .0066, .0061, .0057, .0054, .0051, .0049,
	.0046, .0044, .0042, .0041, .0039, .0037, .0036, .0034,
	.0033, .0032, .0031, .0030, .0029, .0028, .0027, .0026,
	.0025, .0025, .0025, .0024, .0024, .0023, .0022, .0021,
	.0020, .0019, .0018, .0018, .0017, .0016, .0015, .0015,
	.0014, .0010, .0007, .0003, .0000
    };

    /* 1st spectral band of avhrr (noaa 10) */
    static const float sr9[101] = {
	.0000, .0005, .0010, .0015, .0020, .0023, .0025, .0028,
	.0030, .0239, .0448, .0657, .0866, .1852, .2838, .3824,
	.4810, .5470, .6130, .6790, .7450, .7640, .7830, .8020,
	.8210, .8182, .8154, .8126, .8098, .8219, .8339, .8460,
	.8580, .8808, .9035, .9263, .9490, .9607, .9723, .9840,
	.9956, .9875, .9793, .9712, .9630, .9595, .9560, .9525,
	.9490, .9618, .9745, .9872,1.0000, .9980, .9960, .9940,
	.9920, .9013, .8105, .7197, .6290, .5400, .4510, .3620,
	.2730, .2315, .1900, .1485, .1070, .0935, .0800, .0665,
	.0530, .0468, .0405, .0343, .0280, .0255, .0230, .0205,
	.0180, .0165, .0150, .0135, .0120, .0110, .0100, .0090,
	.0080, .0070, .0061, .0051, .0042, .0034, .0026, .0018,
	.0010, .0007, .0005, .0002, .0000
    };

    /* 2nd spectral band of avhrr  (noaa 10) */
    static const float sr10[237] = {
	.0000, .0006, .0012, .0018, .0024, .0030, .0036, .0042,
	.0048, .0049, .0049, .0050, .0051, .0051, .0052, .0052,
	.0053, .0053, .0054, .0054, .0055, .0055, .0056, .0056,
	.0057, .0054, .0050, .0047, .0044, .0041, .0037, .0034,
	.0031, .0031, .0032, .0032, .0033, .0033, .0033, .0034,
	.0034, .0239, .0445, .0650, .0855, .1561, .2267, .2974,
	.3680, .4508, .5335, .6163, .6990, .7430, .7870, .8310,
	.8750, .8918, .9085, .9253, .9420, .9510, .9600, .9690,
	.9780, .9835, .9890, .9945,1.0000, .9933, .9866, .9800,
	.9733, .9661, .9589, .9517, .9445, .9329, .9213, .9096,
	.8980, .8935, .8890, .8845, .8800, .8788, .8775, .8763,
	.8750, .8658, .8565, .8473, .8380, .8415, .8450, .8485,
	.8520, .8508, .8495, .8483, .8470, .8410, .8350, .8290,
	.8230, .8148, .8065, .7983, .7900, .7983, .8065, .8148,
	.8230, .8190, .8150, .8110, .8070, .7990, .7910, .7830,
	.7750, .7712, .7675, .7637, .7600, .7425, .7250, .7075,
	.6900, .6855, .6810, .6765, .6720, .6710, .6700, .6690,
	.6680, .6655, .6630, .6605, .6580, .6455, .6330, .6205,
	.6080, .5993, .5905, .5818, .5730, .5602, .5475, .5347,
	.5220, .4872, .4525, .4177, .3830, .3435, .3040, .2645,
	.2250, .2015, .1780, .1545, .1310, .1155, .1000, .0845,
	.0690, .0613, .0535, .0457, .0380, .0337, .0295, .0252,
	.0210, .0189, .0168, .0147, .0126, .0114, .0102, .0091,
	.0079, .0073, .0067, .0060, .0054, .0051, .0047, .0044,
	.0041, .0040, .0038, .0037, .0036, .0035, .0034, .0033,
	.0032, .0031, .0030, .0030, .0029, .0028, .0027, .0027,
	.0026, .0026, .0025, .0025, .0024, .0023, .0022, .0022,
	.0021, .0020, .0019, .0018, .0017, .0016, .0016, .0015,
	.0015, .0015, .0014, .0014, .0014, .0014, .0014, .0015,
	.0015, .0011, .0008, .0004, .0000
    };
 
    /* 1st spectral band of avhrr (noaa 11) */
    static const float sr11[113] = {
	.0000, .0033, .0065, .0098, .0130, .0500, .0870, .1240,
	.1610, .2385, .3160, .3935, .4710, .5150, .5590, .6030,
	.6470, .6768, .7065, .7363, .7660, .7745, .7830, .7915,
	.8000, .7918, .7835, .7753, .7670, .7747, .7825, .7903,
	.7980, .8215, .8450, .8685, .8920, .8907, .8895, .8882,
	.8870, .8702, .8535, .8367, .8200, .8110, .8020, .7930,
	.7840, .8050, .8260, .8470, .8680, .9010, .9340, .9670,
	1.0000, .9562, .9125, .8687, .8250, .7192, .6135, .5077,
	.4020, .3467, .2915, .2362, .1810, .1568, .1325, .1083,
	.0840, .0735, .0630, .0525, .0420, .0380, .0340, .0300,
	.0260, .0242, .0225, .0207, .0190, .0180, .0170, .0160,
	.0150, .0137, .0125, .0112, .0100, .0087, .0075, .0062,
	.0050, .0052, .0055, .0057, .0060, .0060, .0060, .0060,
	.0060, .0060, .0060, .0060, .0060, .0045, .0030, .0015,
	.0000
    };

    /* 2nd spectral band of avhrr  (noaa 11) */
    static const float sr12[209] = {
	.0000, .0005, .0010, .0015, .0020, .0025, .0030, .0035,
	.0040, .0039, .0037, .0036, .0035, .0034, .0032, .0031,
	.0030, .0029, .0028, .0026, .0025, .0024, .0023, .0021,
	.0020, .0020, .0020, .0020, .0020, .0020, .0020, .0020,
	.0020, .0028, .0035, .0043, .0050, .0173, .0295, .0418,
	.0540, .1150, .1760, .2370, .2980, .3822, .4665, .5507,
	.6350, .6865, .7380, .7895, .8410, .8623, .8835, .9048,
	.9260, .9415, .9570, .9725, .9880, .9910, .9940, .9970,
	1.0000, .9925, .9850, .9775, .9700, .9600, .9500, .9400,
	.9300, .9193, .9085, .8978, .8870, .8770, .8670, .8570,
	.8470, .8478, .8485, .8493, .8500, .8518, .8535, .8553,
	.8570, .8602, .8635, .8668, .8700, .8673, .8645, .8618,
	.8590, .8505, .8420, .8335, .8250, .8183, .8115, .8047,
	.7980, .7983, .7985, .7988, .7990, .7935, .7880, .7825,
	.7770, .7835, .7900, .7965, .8030, .8075, .8120, .8165,
	.8210, .8108, .8005, .7903, .7800, .7767, .7735, .7703,
	.7670, .7473, .7275, .7077, .6880, .6755, .6630, .6505,
	.6380, .6350, .6320, .6290, .6260, .6345, .6430, .6515/
	.6600, .6695, .6790, .6885, .6980, .6790, .6600, .6410,
	.6220, .5645, .5070, .4495, .3920, .3420, .2920, .2420,
	.1920, .1667, .1415, .1162, .0910, .0795, .0680, .0565,
	.0450, .0411, .0372, .0334, .0295, .0256, .0217, .0179,
	.0140, .0129, .0117, .0106, .0095, .0084, .0072, .0061,
	.0050, .0048, .0045, .0043, .0040, .0038, .0035, .0033,
	.0030, .0029, .0027, .0026, .0025, .0024, .0022, .0021,
	.0020, .0017, .0015, .0012, .0010, .0007, .0005, .0002,
	.0000
    };

    /* 1st spectral band of avhrr (noaa 12) */
    static const float sr13[201] = {
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0048, .0135, .0200,
	.0270, .1046, .2094, .3253, .4360, .5286, .6030, .6621,
	.7090, .7464, .7753, .7966, .8110, .8196, .8249, .8301,

	.8380, .8507, .8668, .8837, .8990, .9109, .9198, .9265,
	.9320, .9371, .9419, .9466, .9510, .9552, .9587, .9612,
	.9620, .9610, .9593, .9582, .9590, .9625, .9673, .9715,
	.9730, .9707, .9666, .9635, .9640, .9701, .9799, .9908,
	1.0000, .9805, .9590, .9407, .9180, .8357, .7325, .6205,
	.5120, .4170, .3365, .2692, .2140, .1695, .1343, .1066,
	.0850, .0679, .0546, .0442, .0360, .0294, .0240, .0196,
	.0160, .0130, .0105, .0089, .0080, .0080, .0083, .0085,
	.0080, .0064, .0041, .0018, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0024, .0056, .0087, .0110, .0118, .0117, .0112,
	.0110, .0117, .0130, .0145, .0160, .0171, .0178, .0184,
	.0190, .0197, .0205, .0213, .0220, .0226, .0229, .0228,
	.0220, .0205, .0187, .0170, .0160, .0159, .0160, .0157,
	.0140, .0106, .0063, .0023, .0000, .0001, .0018, .0038,
	.0050, .0044, .0027, .0009, .0000, .0006, .0023, .0040,
	.0050, .0046, .0032, .0015, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000
    };

    /* 2nd spectral band of avhrr  (noaa 12) */
    static const float sr14[189] = {
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0050, .0111, .0162, .0180, .0153, .0097, .0038,
	.0000, .0005, .0060, .0168, .0330, .0555, .0869, .1303,
	.1890, .2643, .3509, .4418, .5300, .6096, .6796, .7403,
	.7920, .8350, .8702, .8988, .9220, .9408, .9559, .9680,
	.9780, .9863, .9929, .9975,1.0000, .0115, .9987, .9958,
	.9920, .9876, .9821, .9748, .9650, .9522, .9370, .9203,
	.9030, .8858, .8694, .8543, .8410, .8299, .8207, .8129,
	.8060, .7997, .7943, .7902, .7880, .7879, .7893, .7916,
	.7940, .7959, .7971, .7972, .7960, .7935, .7900, .7860,
	.7820, .7783, .7747, .7704, .7650, .7582, .7506, .7433,
	.7370, .7326, .7299, .7288, .7290, .7303, .7323, .7350,
	.7380, .7411, .7441, .7468, .7490, .7504, .7510, .7505,
	.7490, .7463, .7421, .7365, .7290, .7197, .7086, .6960,
	.6820, .6670, .6518, .6371, .6240, .6131, .6043, .5973,
	.5920, .5881, .5857, .5849, .5860, .5889, .5929, .5969,
	.6000, .6011, .5986, .5905, .5750, .5508, .5186, .4792,
	.4340, .3842, .3326, .2822, .2360, .1964, .1633, .1357,
	.1130, .0943, .0789, .0664, .0560, .0473, .0400, .0339,
	.0290, .0250, .0217, .0191, .0170, .0152, .0137, .0123,
	.0110, .0098, .0086, .0077, .0070, .0066, .0063, .0059,
	.0050, .0035, .0019, .0005, .0000, .0006, .0019, .0033,
	.0040, .0036, .0025, .0011, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000
    };

    /* 1st spectral band of avhrr (noaa 14) -from NOAA/POD Guide */
    static const float sr15[241] = {
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0003, .0007, .0010, .0013, .0152, .0290, .0429,
	.0568, .1226, .1884, .2543, .3201, .3727, .4254, .4780,
	.5306, .5528, .5749, .5971, .6193, .6267, .6342, .6417,
	.6492, .6538, .6583, .6629, .6675, .6734, .6793, .6853,
	.6912, .6948, .6984, .7020, .7056, .7106, .7156, .7206,
	.7256, .7243, .7229, .7216, .7203, .7188, .7174, .7159,
	.7145, .7130, .7116, .7102, .7088, .7154, .7221, .7287,
	.7353, .7292, .7232, .7172, .7111, .6501, .5891, .5281,
	.4671, .4037, .3402, .2768, .2133, .1830, .1527, .1223,
	.0920, .0797, .0675, .0553, .0431, .0406, .0381, .0357,
	.0332, .0279, .0226, .0173, .0120, .0117, .0114, .0110,
	.0107, .0100, .0093, .0086, .0080, .0076, .0072, .0069,
	.0065, .0062, .0059, .0055, .0052, .0051, .0050, .0048,
	.0047, .0048, .0049, .0050, .0051, .0051, .0050, .0050,
	.0050, .0050, .0051, .0052, .0052, .0053, .0054, .0054,
	.0055, .0057, .0059, .0061, .0063, .0068, .0072, .0076,
	.0080, .0084, .0088, .0092, .0096, .0100, .0104, .0108,
	.0113, .0116, .0119, .0122, .0125, .0127, .0128, .0130,
	.0132, .0130, .0128, .0126, .0123, .0120, .0116, .0112,
	.0108, .0104, .0099, .0095, .0090, .0086, .0082, .0078,
	.0074, .0072, .0070, .0067, .0065, .0063, .0060, .0058,
	.0055, .0053, .0050, .0048, .0046, .0044, .0042, .0040,
	.0038, .0036, .0034, .0032, .0030, .0028, .0027, .0025,
	.0023, .0022, .0022, .0021, .0020, .0019, .0018, .0017,
	.0016, .0016, .0015, .0014, .0014, .0013, .0012, .0012,
	.0011, .0011, .0011, .0011, .0011, .0011, .0011, .0011,
	.0011, .0011, .0011, .0011, .0011, .0011, .0011, .0010,
	.0010, .0010, .0010, .0010, .0010, .0010, .0010, .0010,
	.0010
    };

    /* 2nd spectral band of avhrr (noaa 14) */
    static const float sr16[176] = {
	.0000,.0000,.0000,.0000,.0000,.0000,.0022,.0045,
	.0067,.0090,.0107,.0125,.0143,.0160,.0543,.0925,
	.1308,.1690,.2573,.3455,.4338,.5220,.5978,.6735,
	.7492,.8250,.8503,.8755,.9007,.9260,.9362,.9465,
	.9568,.9670,.9737,.9805,.9872,.9940,.9935,.9930,
	.9925,.9920,.9940,.9960,.9980,1.000,.9885,.9770,
	.9655,.9540,.9398,.9255,.9112,.8970,.8855,.8740,
	.8625,.8510,.8400,.8290,.8180,.8070,.8052,.8035,
	.8018,.8000,.8065,.8130,.8195,.8260,.8257,.8255,
	.8253,.8250,.8245,.8240,.8235,.8230,.8230,.8230,
	.8230,.8230,.8210,.8190,.8170,.8150,.8147,.8145,
	.8142,.8140,.8183,.8225,.8267,.8310,.8367,.8425,
	.8482,.8540,.8547,.8555,.8562,.8570,.8510,.8450,
	.8390,.8330,.8170,.8010,.7850,.7690,.7587,.7485,
	.7383,.7280,.7203,.7125,.7048,.6970,.6957,.6945,
	.6932,.6920,.6970,.7020,.7070,.7120,.7035,.6950,
	.6865,.6780,.6370,.5960,.5550,.5140,.4560,.3980,
	.3400,.2820,.2458,.2095,.1732,.1370,.1190,.1010,
	.0830,.0650,.0560,.0470,.0380,.0290,.0250,.0210,
	.0170,.0130,.0095,.0060,.0050,.0040,.0020,.0000,
	.0010,.0020,.0018,.0015,.0012,.0010,.0010,.0010,
	.0010,.0010,.0008,.0005,.0003,.0000,.0000,.0000
    };

    static const float wli[16] = { 0.55, 0.69, 0.5, 0.64, 0.54, 0.68, 0.53, 0.68, 0.53, 0.60, 0.54, 0.60, 0.50, 0.65, 0.50, 0.68 };
    static const float wls[16] = { 0.75, 1.12, 0.8, 1.17, 1.01, 1.12, 0.81, 1.17, 0.78, 1.19, 0.82, 1.12, 1.00, 1.12, 1.11, 1.10 };

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 80; i++)  ffu.s[120+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 173; i++) ffu.s[176+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 121; i++) ffu.s[100+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 213; i++) ffu.s[156+i] = sr4[i];
	break;
    case 5: for(i = 0; i < 189; i++) ffu.s[116+i] = sr5[i];
	break;
    case 6: for(i = 0; i < 177; i++) ffu.s[172+i] = sr6[i];
	break;
    case 7: for(i = 0; i < 113; i++) ffu.s[112+i] = sr7[i];
	break;
    case 8: for(i = 0; i < 197; i++) ffu.s[172+i] = sr8[i];
	break;
    case 9: for(i = 0; i < 101; i++) ffu.s[112+i] = sr9[i];
	break;
    case 10: for(i = 0; i < 237; i++) ffu.s[140+i] = sr10[i];
	break;
    case 11: for(i = 0; i < 113; i++) ffu.s[116+i] = sr11[i];
	break;
    case 12: for(i = 0; i < 209; i++) ffu.s[140+i] = sr12[i];
	break;
    case 13: for(i = 0; i < 201; i++) ffu.s[100+i] = sr13[i];
	break;
    case 14: for(i = 0; i < 189; i++) ffu.s[160+i] = sr14[i];
	break;
    case 15: for(i = 0; i < 241; i++) ffu.s[100+i] = sr15[i];
	break;
    case 16: for(i = 0; i < 176; i++) ffu.s[168+i] = sr16[i];
    }
}

void IWave::hrv(int iwa)
{

    /* 1st spectral band of hrv1 */
    static const float sr1[73] = {
	.0010, .0023, .0035, .0048, .0060, .0492, .0925, .1357,
	.1790, .2598, .3405, .4213, .5020, .5575, .6130, .6685,
	.7240, .7588, .7935, .8283, .8630, .8900, .9170, .9440,
	.9710, .9782, .9855, .9927,1.0000, .9875, .9750, .9625,
	.9500, .9255, .9010, .8765, .8520, .8225, .7930, .7635,
	.7340, .7105, .6870, .6635, .6400, .5945, .5490, .5035,
	.4580, .3985, .3390, .2795, .2200, .1787, .1375, .0962,
	.0550, .0437, .0325, .0212, .0100, .0085, .0070, .0055,
	.0040, .0035, .0030, .0025, .0020, .0015, .0010, .0005,
	.0000
    };

    /* 2nd spectral band of hrv1 */
    static const float sr2[49] = {
	.0190, .0845, .1500, .2155, .2810, .3870, .4930, .5990,
	.7050, .7663, .8275, .8888, .9500, .9557, .9615, .9672,
	.9730, .9797, .9865, .9933,1.0000, .8445, .6890, .5335,
	.3780, .3152, .2525, .1897, .1270, .1067, .0865, .0662,
	.0460, .0395, .0330, .0265, .0200, .0172, .0145, .0117,
	.0090, .0080, .0070, .0060, .0050, .0045, .0040, .0035,
	.0030
    };

    /* 3rd spectral band of hrv1 */
    static const float sr3[81] = {
	.0010, .0033, .0055, .0078, .0100, .0238, .0375, .0513,
	.0650, .0953, .1255, .1558, .1860, .2470, .3080, .3690,
	.4300, .4918, .5535, .6153, .6770, .7222, .7675, .8127,
	.8580, .8825, .9070, .9315, .9560, .9670, .9780, .9890,
	1.0000, .9915, .9830, .9745, .9660, .9557, .9455, .9352,
	.9250, .9112, .8975, .8837, .8700, .8777, .8855, .8932,
	.9010, .8342, .7675, .7007, .6340, .5600, .4860, .4120,
	.3380, .2875, .2370, .1865, .1360, .1130, .0900, .0670,
	.0440, .0360, .0280, .0200, .0120, .0108, .0095, .0083,
	.0070, .0067, .0065, .0062, .0060, .0047, .0035, .0022,
	.0010
    };

    /* panchromatic band of hrv1 */
    static const float sr4[129] = {
	.0000, .0013, .0025, .0038, .0050, .0322, .0595, .0867,
	.1140, .1723, .2305, .2888, .3470, .3748, .4025, .4303,
	.4580, .4750, .4920, .5090, .5260, .5538, .5815, .6093,
	.6370, .6575, .6780, .6985, .7190, .7228, .7265, .7303,
	.7340, .7370, .7400, .7430, .7460, .7595, .7730, .7865,
	.8000, .8163, .8325, .8488, .8650, .8767, .8885, .9003,
	.9120, .9137, .9155, .9172, .9190, .9245, .9300, .9355,
	.9410, .9387, .9365, .9342, .9320, .9373, .9425, .9478,
	.9530, .9575, .9620, .9665, .9710, .9783, .9855, .9928,
	1.0000, .9898, .9795, .9693, .9590, .9450, .9310, .9170,
	.9030, .8780, .8530, .8280, .8030, .7770, .7510, .7250,
	.6990, .6820, .6650, .6480, .6310, .6235, .6160, .6085,
	.6010, .5535, .5060, .4585, .4110, .3620, .3130, .2640,
	.2150, .1825, .1500, .1175, .0850, .0720, .0590, .0460,
	.0330, .0282, .0235, .0187, .0140, .0120, .0100, .0080,
	.0060, .0055, .0050, .0045, .0040, .0035, .0030, .0025,
	.0020
    };

    /* 1st spectral band of hrv2 */
    static const float sr5[73] = {
	.0010, .0015, .0020, .0025, .0030, .0040, .0050, .0060,
	.0070, .0850, .1630, .2410, .3190, .3918, .4645, .5373,
	.6100, .6500, .6900, .7300, .7700, .7965, .8230, .8495,
	.8760, .8957, .9155, .9352, .9550, .9663, .9775, .9888,
	1.0000, .9915, .9830, .9745, .9660, .9362, .9065, .8767,
	.8470, .8147, .7825, .7502, .7180, .6660, .6140, .5620,
	.5100, .4638, .4175, .3713, .3250, .2737, .2225, .1712,
	.1200, .1012, .0825, .0637, .0450, .0377, .0305, .0232,
	.0160, .0122, .0085, .0047, .0010, .0007, .0005, .0002,
	.0000
    };

    /* 2nd spectral band of hrv2 */
    static const float sr6[57] = {	
	.0040, .0045, .0050, .0055, .0060, .0115, .0170, .0225,
	.0280, .0893, .1505, .2118, .2730, .3593, .4455, .5318,
	.6180, .6803, .7425, .8048, .8670, .9003, .9335, .9668,
	1.0000, .9365, .8730, .8095, .7460, .6830, .6200, .5570,
	.4940, .4405, .3870, .3335, .2800, .2452, .2105, .1757,
	.1410, .1222, .1035, .0847, .0660, .0575, .0490, .0405,
	.0320, .0283, .0245, .0208, .0170, .0152, .0135, .0117,
	.0100
    };

    /* 3rd spectral band of hrv2 */
    static const float sr7[81] = {	
	.0020, .0030, .0040, .0050, .0060, .0105, .0150, .0195,
	.0240, .0380, .0520, .0660, .0800, .1140, .1480, .1820,
	.2160, .2722, .3285, .3847, .4410, .5018, .5625, .6233,
	.6840, .7298, .7755, .8213, .8670, .8920, .9170, .9420,
	.9670, .9753, .9835, .9918,1.0000, .9967, .9935, .9902,
	.9870, .9793, .9715, .9638, .9560, .9500, .9440, .9380,
	.9320, .9047, .8775, .8502, .8230, .7665, .7100, .6535,
	.5970, .5305, .4640, .3975, .3310, .2850, .2390, .1930,
	.1470, .1250, .1030, .0810, .0590, .0497, .0405, .0312,
	.0220, .0185, .0150, .0115, .0080, .0062, .0045, .0027,
	.0010
    };
 
    /* panchromatic spectral band of hrv2 */
    static const float sr8[129] = {	
	.0010, .0013, .0015, .0018, .0020, .0137, .0255, .0372,
	.0490, .0898, .1305, .1713, .2120, .2468, .2815, .3163,
	.3510, .3725, .3940, .4155, .4370, .4655, .4940, .5225,
	.5510, .5742, .5975, .6207, .6440, .6505, .6570, .6635,
	.6700, .6752, .6805, .6858, .6910, .7032, .7155, .7278,
	.7400, .7530, .7660, .7790, .7920, .8027, .8135, .8242,
	.8350, .8427, .8505, .8582, .8660, .8692, .8725, .8758,
	.8790, .8830, .8870, .8910, .8950, .9025, .9100, .9175,
	.9250, .9365, .9480, .9595, .9710, .9783, .9855, .9928,
	1.0000, .9930, .9860, .9790, .9720, .9548, .9375, .9202,
	.9030, .8802, .8575, .8347, .8120, .7945, .7770, .7595,
	.7420, .7062, .6705, .6347, .5990, .5587, .5185, .4782,
	.4380, .3893, .3405, .2918, .2430, .2085, .1740, .1395,
	.1050, .0895, .0740, .0585, .0430, .0367, .0305, .0242,
	.0180, .0155, .0130, .0105, .0080, .0070, .0060, .0050,
	.0040, .0035, .0030, .0025, .0020, .0018, .0015, .0013,
	.0010
    };

    static const float wli[8] = { 0.4699999, 0.60, 0.73, 0.4699999, 0.4699999, 0.5899999, 0.74, 0.4699999 };
    static const float wls[8] = { 0.6499999, 0.72, 0.93, 0.7900000, 0.6499999, 0.7300000, 0.94, 0.7900000 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 73; i++)	 ffu.s[88+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 49; i++)	 ffu.s[140+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 81; i++)	 ffu.s[192+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 129; i++)	 ffu.s[88+i] = sr4[i];
	break;
    case 5: for(i = 0; i < 73; i++)	 ffu.s[88+i] = sr5[i];
	break;
    case 6: for(i = 0; i < 57; i++)	 ffu.s[136+i] = sr6[i];
	break;
    case 7: for(i = 0; i < 81; i++)	 ffu.s[196+i] = sr7[i];
	break;
    case 8: for(i = 0; i < 129; i++)	 ffu.s[88+i] = sr8[i];
	break;
    }
}


void IWave::tm(int iwa)
{
    /* 1st spectral band of thematic mapper */
    static const float sr1[53] = {		
	.0030, .0085, .0140, .0255, .0370, .0500, .0630, .2010,
	.3390, .5030, .6670, .6935, .7200, .7525, .7850, .8030,
	.8210, .8370, .8530, .8780, .9030, .9135, .9240, .9355,
	.9470, .9625, .9780, .9835, .9890, .9860, .9830, .9060,
	.8290, .7815, .7340, .5265, .3190, .1995, .0800, .0630,
	.0460, .0380, .0300, .0230, .0160, .0120, .0080, .0065,
	.0050, .0045, .0040, .0035, .0030
    };

    /* 2nd spectral band of thematic mapper */
    static const float sr2[61] = {
	.0010, .0055, .0100, .0165, .0230, .0305, .0380, .1010,
	.1640, .2710, .3780, .4750, .5720, .6150, .6580, .6945,
	.7310, .7575, .7840, .8105, .8370, .8510, .8650, .8770,
	.8890, .8965, .9040, .9055, .9070, .9070, .9070, .9095,
	.9120, .9310, .9500, .9685, .9870, .9951, .9980, .9705,
	.9430, .8655, .7880, .6250, .4620, .3330, .2040, .1505,
	.0970, .0745, .0520, .0440, .0360, .0285, .0210, .0165,
	.0120, .0090, .0060, .0030, .0000
    };

    /* 3rd spectral band of thematic mapper */
    static const float sr3[65] = { 
	.0020, .0020, .0020, .0020, .0020, .0030, .0040, .0060,
	.0080, .0140, .0200, .0290, .0380, .0730, .1080, .2020,
	.2960, .3840, .4720, .5245, .5770, .6625, .7480, .7830,
	.8180, .8430, .8680, .8845, .9010, .9030, .9050, .9055,
	.9060, .9200, .9340, .9520, .9700, .9815, .9930,1.0000,
	.9980, .9770, .9560, .8715, .7870, .5775, .3680, .2435,
	.1190, .0920, .0650, .0555, .0460, .0385, .0310, .0255,
	.0200, .0160, .0120, .0090, .0060, .0055, .0050, .0040,
	.0030
    };

    /* 4th spectral band of thematic mapper */
    static const float sr4[89] = {  
	.0020, .0035, .0050, .0060, .0070, .0080, .0090, .0140,
	.0190, .0260, .0330, .0520, .0710, .1035, .1360, .2055,
	.2750, .3615, .4480, .5505, .6530, .7410, .8290, .8795,
	.9300, .9520, .9740, .9870,1.0000, .9955, .9910, .9855,
	.9800, .9685, .9570, .9465, .9360, .9260, .9160, .9165,
	.9170, .9180, .9190, .9195, .9200, .9215, .9230, .9240,
	.9250, .9160, .9070, .8965, .8860, .8835, .8810, .8825,
	.8840, .8825, .8810, .8705, .8600, .8410, .8220, .8030,
	.7840, .7715, .7590, .7370, .7150, .5905, .4660, .3385,
	.2110, .1440, .0770, .0540, .0310, .0230, .0150, .0115,
	.0080, .0070, .0060, .0050, .0040, .0030, .0020, .0010,
	.0000
    };
	 
    /* 5th spectral band of thematic mapper */
    static const float sr5[156] = { 
	.0000, .0003, .0007, .0010, .0013, .0015, .0018, .0020,
	.0038, .0055, .0073, .0090, .0123, .0155, .0188, .0220,
	.0393, .0565, .0738, .0910, .1410, .1910, .2410, .2910,
	.3617, .4325, .5032, .5740, .6383, .7025, .7668, .8310,
	.8622, .8935, .9248, .9560, .9522, .9485, .9447, .9410,
	.9417, .9425, .9433, .9440, .9505, .9570, .9635, .9700,
	.9738, .9775, .9813, .9850, .9833, .9815, .9797, .9780,
	.9747, .9715, .9682, .9650, .9682, .9715, .9747, .9780,
	.9793, .9805, .9818, .9830, .9837, .9845, .9852, .9860,
	.9838, .9815, .9793, .9770, .9815, .9860, .9905, .9950,
	.9963, .9975, .9988,1.0000, .9992, .9985, .9977, .9970,
	.9912, .9855, .9797, .9740, .9697, .9655, .9613, .9570,
	.9553, .9535, .9517, .9500, .9505, .9510, .9515, .9520,
	.9370, .9220, .9070, .8920, .8260, .7600, .6940, .6280,
	.5507, .4735, .3962, .3190, .2780, .2370, .1960, .1550,
	.1340, .1130, .0920, .0710, .0643, .0575, .0508, .0440,
	.0385, .0330, .0275, .0220, .0197, .0175, .0152, .0130,
	.0120, .0110, .0100, .0090, .0077, .0065, .0052, .0040,
	.0037, .0035, .0032, .0030, .0027, .0025, .0022, .0020,
	.0015, .0010, .0005, .0000
    };

    /* 7th spectral band of thematic mapper */
    static const float sr6[185] = { 
	.0000, .0005, .0010, .0015, .0020, .0025, .0030, .0035,
	.0040, .0043, .0045, .0048, .0050, .0055, .0060, .0065,
	.0070, .0075, .0080, .0085, .0090, .0103, .0115, .0128,
	.0140, .0153, .0165, .0178, .0190, .0233, .0275, .0318,
	.0360, .0400, .0440, .0480, .0520, .0563, .0605, .0648,
	.0690, .0768, .0845, .0923, .1000, .1125, .1250, .1375,
	.1500, .1753, .2005, .2258, .2510, .2870, .3230, .3590,
	.3950, .4313, .4675, .5038, .5400, .5788, .6175, .6563,
	.6950, .7345, .7740, .8135, .8530, .8737, .8945, .9152,
	.9360, .9398, .9435, .9473, .9510, .9472, .9435, .9397,
	.9360, .9385, .9410, .9435, .9460, .9500, .9540, .9580,
	.9620, .9693, .9765, .9838, .9910, .9930, .9950, .9970,
	.9990,1.0000, .9988, .9975, .9960, .9952, .9945, .9937,
	.9930, .9922, .9915, .9908, .9900, .9815, .9730, .9645,
	.9560, .9525, .9490, .9455, .9420, .9370, .9320, .9270,
	.9220, .9205, .9190, .9175, .9160, .9135, .9110, .9085,
	.9060, .9020, .8980, .8940, .8900, .8730, .8560, .8390,
	.8220, .8058, .7895, .7732, .7570, .7545, .7520, .7495,
	.7470, .7623, .7775, .7928, .8080, .8245, .8410, .8575,
	.8740, .8292, .7845, .7397, .6950, .6290, .5630, .4970,
	.4310, .3747, .3185, .2622, .2060, .1735, .1410, .1085,
	.0760, .0653, .0545, .0438, .0330, .0275, .0220, .0165,
	.0110, .0097, .0085, .0072, .0060, .0045, .0030, .0015,
	.0000
    };

    static const float wli[6] = { 0.43, 0.5000000, 0.5799999, 0.73, 1.5025, 1.95 };
    static const float wls[6] = { 0.56, 0.6499999, 0.7400000, 0.95, 1.8900, 2.41 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 53; i++)	 ffu.s[72+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 61; i++)	 ffu.s[100+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 65; i++)	 ffu.s[132+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 89; i++)	 ffu.s[192+i] = sr4[i];
	break;
    case 5: for(i = 0; i < 156; i++)	 ffu.s[501+i] = sr5[i];
	break;
    case 6: for(i = 0; i < 185; i++)	 ffu.s[680+i] = sr6[i];
	break;
    }
}

void IWave::mss(int iwa)
{
    /* 1st spectral band of multi spectral scanner */
    static const float sr1[67] = { 
	.00,    .01,    .01,    .01,    .02,    .04,    .05,
	.09,    .13,    .21,    .29,    .45,    .61,    .72,
	.82,    .85,    .89,    .92,    .95,    .96,    .98,
	.99,    .99,   1.00,   1.00,   1.00,   1.00,   1.00,
	1.00,   1.00,   .99,    .99,    .98,    .98,    .98,
	.97,    .97,    .96,    .96,    .96,    .96,    .95,
	.95,    .93,    .91,    .89,    .87,    .85,    .82,
	.73,    .65,    .54,    .43,    .38,    .33,    .24,
	.15,    .11,    .08,    .06,    .04,    .03,    .03,
	.02,    .02,    .02,    .01
    };

    /* 2nd spectral band of multi spectral scanner */
    static const float sr2[69] = { 
	.01,    .01,    .01,    .01,    .01,    .01,    .02,
	.03,    .04,    .08,    .13,    .21,    .29,    .43,
	.57,    .69,    .80,    .86,    .92,    .94,    .96,
	.97,    .99,    .99,   1.00,   1.00,   1.00,    .99,
	.98,    .97,    .96,    .94,    .93,    .90,    .88,
	.92,    .96,    .96,    .96,    .95,    .95,    .90,
	.84,    .82,    .80,    .79,    .78,    .79,    .80,
	.80,    .80,    .73,    .67,    .59,    .50,    .38,
	.25,    .18,    .11,    .09,    .08,    .07,    .06,
	.05,    .05,    .04,    .04,    .03,    .03
    };

    /* 3rd spectral band of multi spectral scanner */
    static const float sr3[81] = { 
	.01,    .01,    .01,    .02,    .02,    .02,    .02,
	.03,    .03,    .05,    .07,    .10,    .14,    .17,
	.20,    .31,    .41,    .48,    .56,    .66,    .75,
	.83,    .90,    .93,    .97,    .98,    .99,   1.00,
	1.00,   1.00,   .99,    .99,    .98,    .97,    .96,
	.94,    .93,    .90,    .88,    .87,    .86,    .84,
	.83,    .82,    .82,    .82,    .82,    .82,    .83,
	.83,    .83,    .83,    .83,    .81,    .80,    .78,
	.75,    .68,    .61,    .55,    .49,    .41,    .34,
	.29,    .24,    .19,    .15,    .12,    .08,    .07,
	.07,    .05,    .03,    .03,    .03,    .02,    .02,
	.01,    .01,    .01,    .01
    };

    /* 4th spectral band of multi spectral scanner */
    static const float sr4[127] = { 
	.01,    .02,    .02,    .04,    .06,    .14,    .21,
	.45,    .68,    .76,    .83,    .89,    .94,    .94,
	.94,    .94,    .95,    .95,    .96,    .97,    .98,
	.99,    .99,   1.00,   1.00,   1.00,   1.00,   1.00,
	1.00,   1.00,   .99,    .98,    .97,    .96,    .95,
	.94,    .93,    .92,    .92,    .91,    .90,    .89,
	.88,    .87,    .86,    .86,    .85,    .83,    .82,
	.81,    .80,    .78,    .77,    .76,    .76,    .75,
	.74,    .72,    .70,    .69,    .68,    .66,    .64,
	.63,    .62,    .61,    .60,    .58,    .57,    .56/
	.55,    .55,    .54,    .52,    .51,    .50,    .49,
	.47,    .46,    .45,    .44,    .43,    .42,    .41,
	.40,    .39,    .39,    .38,    .37,    .36,    .35,
	.34,    .33,    .32,    .31,    .30,    .29,    .28,
	.27,    .26,    .25,    .24,    .23,    .22,    .21,
	.20,    .20,    .19,    .18,    .16,    .15,    .14,
	.13,    .12,    .12,    .11,    .10,    .08,    .07,
	.06,    .06,    .05,    .04,    .03,    .02,    .01,
	.01
    };

    static const float wli[4] = { 0.4749999, 0.5799999, 0.6549999, 0.7849999 };
    static const float wls[4] = { 0.6399999, 0.7500000, 0.8549998, 1.1000000 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 67; i++)	 ffu.s[90+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 69; i++)	 ffu.s[132+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 81; i++)	 ffu.s[162+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 127; i++)	 ffu.s[214+i] = sr4[i];
	break;
    }
}

void IWave::mas(int iwa)
{
    /* first spectral band of Modis airborne simulator */
    static const float sr1[35] = {
	.0244, .0338, .0536, .1052, .1941, .3166, .4797, .6893,
	.9417,1.2218,1.4890,1.7202,1.9194,2.0812,2.1934,2.2580,
	2.3031,2.3395,2.3620,2.3575,2.3228,2.2421,2.1129,1.9317,
	1.7031,1.4126,1.0985, .8088, .5573, .3477, .1843, .0918,
	.0473, .0308, .0248
    };

    /* second spectral band of Modis airborne simulator */
    static const float sr2[38] = {
	.0197, .0223, .0298, .0481, .0877, .1645, .2829, .4699,
	.7101, .9752,1.2209,1.4459,1.6307,1.7482,1.8092,1.8370,
	1.8465,1.8527,1.8574,1.8627,1.8703,1.8733,1.8763,1.8769,
	1.8731,1.8599,1.8221,1.7208,1.5341,1.2689, .9810, .6911,
	.4250, .2204, .0947, .0447, .0253, .0209
    };

    /* third spectral band of Modis airborne simulator */
    static const float sr3[34] = {
	.0273, .0357, .0560, .1265, .3269, .6239, .9777,1.3481,
	1.7037,2.0081,2.1885,2.2765,2.3178,2.3474,2.3777,2.4053,
	2.4286,2.4487,2.4604,2.4324,2.2594,1.9695,1.6105,1.2200,
	.8289, .4724, .2484, .1443, .0998, .0726, .0546, .0421,
	.0333, .0270
    };

    /* fourth spectral band of Modis airborne simulator */
    static const float sr4[40] = {
	.0242, .0276, .0364, .0505, .0717, .1058, .1841, .3889,
	.7570,1.1872,1.6245,1.9511,2.0986,2.1652,2.2058,2.2430,
	2.2471,2.2299,2.2190,2.2052,2.1875,2.1519,2.0989,2.0314,
	1.9292,1.7185,1.3603, .9476, .5555, .2803, .1608, .1090,
	.0926, .0830, .0720, .0590, .0476, .0377, .0300, .0245
    };

    /* fifth spectral band of Modis airborne simulator */

    static const float sr5[56] = {
	.0232, .0234, .0254, .0259, .0300, .0313, .0325, .0368,
	.0397, .0432, .0454, .0525, .0624, .0839, .1305, .2066,
	.3012, .4087, .5292, .6814, .8961,1.1607,1.4407,1.6803,
	1.8543,1.9683,2.0260,2.0562,2.0704,2.0550,2.0031,1.9304,
	1.8731,1.8325,1.7974,1.7334,1.6188,1.4710,1.2919,1.0871,
	.8785, .6871, .5194, .3728, .2565, .1667, .1099, .0720,
	.0536, .0434, .0375, .0355, .0324, .0281, .0251, .0214
    };

    
    /* sixth spectral band of Modis airborne simulator */
    static const float sr6[40] = {
	.0229, .0271, .0404, .0690, .1237, .2051, .3206, .4619,
	.6269, .8073,1.0025,1.2045,1.4075,1.5980,1.7690,1.9111,
	2.0102,2.0697,2.0965,2.1009,2.0903,2.0685,2.0262,1.9608,
	1.8675,1.7447,1.5974,1.4411,1.2742,1.0954, .9031, .7062,
	.5164, .3475, .2148, .1205, .0665, .0376, .0254, .0211
    };

    /* seventh spectral band of Modis airborne simulator */
    static const float sr7[117] = {
	.0075, .0087, .0108, .0133, .0168, .0208, .0257, .0312,
	.0379, .0456, .0540, .0629, .0728, .0828, .0937, .1054,
	.1189, .1329, .1478, .1618, .1729, .1845, .1963, .2095,
	.2206, .2326, .2448, .2578, .2714, .2864, .3033, .3192,
	.3349, .3515, .3724, .3922, .4100, .4291, .4477, .4674,
	.4824, .4992, .5197, .5436, .5681, .5908, .6099, .6204,
	.6284, .6393, .6466, .6466, .6488, .6531, .6575, .6612,
	.6572, .6566, .6577, .6602, .6649, .6595, .6568, .6522,
	.6606, .6656, .6606, .6517, .6426, .6374, .6311, .6217,
	.6053, .5933, .5827, .5672, .5483, .5325, .5241, .5121,
	.5077, .4958, .4827, .4718, .4552, .4369, .4200, .4076,
	.3921, .3730, .3550, .3397, .3224, .3045, .2849, .2622,
	.2426, .2223, .2035, .1830, .1628, .1416, .1211, .1033,
	.0871, .0731, .0606, .0491, .0395, .0315, .0245, .0189,
	.0151, .0117, .0093, .0076, .0070
    };
    
    /* third band of MODIS (469nm) soil and vegetation differences */
    static const float sr8[13] = {
	.0732, .8372,3.6403,4.9195,5.0091,5.0102,5.0102,5.0099,
	4.9670,4.0931,1.2880, .1186, .0237
    };

    /* fifth band of MODIS ( 1.24micron)  leaf and canopy properties */
    static const float sr9[25] = {
	.0094, .0143, .0248, .0457, .0902, .1928, .4494,1.1087,
	2.4282,3.6387,4.5556,4.9434,4.9975,4.9434,4.5556,3.6387,
	2.4282,1.1087, .4494, .1928, .0902, .0457, .0248, .0143,
	.0094
    };

    /* sixth band of MODIS ( 1.64microns) snow and cloud differences */
    static const float sr10[27] = {
	.0215, .0307, .0493, .0827, .1454, .2693, .5240,1.0412,
	1.9431,2.6724,3.3494,3.8269,4.0296,4.0624,4.0296,3.8269,
	3.3494,2.6724,1.9097,1.0412, .5240, .2693, .1454, .0827,
	.0493, .0307, .0215
    };

    static const float wli[10] = { 0.5025, 0.6075, 0.8300, 0.9000, 1.8200, 2.0950, 3.5800, 0.4550, 1.2100, 1.6075 };
    static const float wls[10] = { 0.5875, 0.7000, 0.9125, 0.9975, 1.9575, 2.1925, 3.8700, 0.4850, 1.2700, 1.6725 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 35; i++)	 ffu.s[101+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 38; i++)	 ffu.s[143+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 34; i++)	 ffu.s[232+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 40; i++)	 ffu.s[260+i] = sr4[i];
	break;
    case 5: for(i = 0; i < 56; i++)	 ffu.s[628+i] = sr5[i];
	break;
    case 6: for(i = 0; i < 40; i++)	 ffu.s[738+i] = sr6[i];
	break;
    case 7: for(i = 0; i < 117; i++)	 ffu.s[1332+i] = sr7[i];
	break;
    case 8: for(i = 0; i < 13; i++)	 ffu.s[82+i] = sr8[i];
	break;
    case 9: for(i = 0; i < 25; i++)	 ffu.s[384+i] = sr9[i];
	break;
    case 10: for(i = 0; i < 27; i++)	 ffu.s[543+i] = sr10[i];
	break;
    }
}

void IWave::modis(int iwa)
{
    /* band 1 of MODIS (vegetation monitoring at 250m) */
    static const float sr1[31] = {
	.0000, .0000, .0101, .0984, .2914, .5020, .6564, .6881,
	.7064, .7114, .7292, .7523, .7721, .7852, .8112, .8664,
	.9309, .9794,1.0000, .9855, .9333, .8429, .7187, .5672,
	.3996, .2327, .1024, .0369, .0157, .0092, .0000
    };

    /* band 2 of MODIS (vegetation monitoring at 250m) */
    static const float sr2[34] = {
	.0000, .0216, .0502, .0923, .1431, .1938, .2713, .4292,
	.6543, .8606, .9672, .9609, .9418, .9273, .9311, .9550,
	.9827, .9948,1.0000, .9782, .9308, .7860, .5430, .2931,
	.1477, .0824, .0520, .0367, .0276, .0213, .0159, .0112,
	.0076, .0000
    };

    /* band 3 of MODIS (vegetation monitoring at 500m / MVI) */
    static const float sr3[14] = {
	.0000, .0222, .2021, .7451,1.0141, .9036, .8745, .9242,
	1.0009, .9305, .5877, .1496, .0170, .0000
    };

    /* band 4 of MODIS (green channel at 500m ) */
    static const float sr4[13] = {
	.0286, .2645, .7583, .9889,1.0002, .9750, .9726, .9878,
	.9622, .7041, .2147, .0163, .0000
    };

    /* band 5 of MODIS (cloud channel at 500m ) */
    static const float sr5[23] = {
	.0000, .0188, .0381, .0984, .1872, .3188, .4933, .6582,
	.8046, .8877, .9564, .9973,1.0000, .9451, .8172, .6366,
	.3949, .2260, .1218, .0623, .0253, .0173, .0000
    };

    /* band 6 of MODIS (snow/ice channel at 500m ) */
    static const float sr6[27] = {
	.0000, .0580, .0910, .1611, .2705, .4289, .6049, .7688,
	.8948, .9729,1.0000, .9969, .9875, .9648, .9278, .8629,
	.7530, .6041, .4342, .2748, .1614, .0911, .0508, .0299,
	.0162, .0108, .0000
    };

    /* band 7 of MODIS (liquid water absorption channel at 500m ) */
    static const float sr7[51] = {
	.0000, .0124, .0165, .0229, .0317, .0444, .0630, .0918,
	.1358, .2006, .2904, .4032, .5329, .6632, .7775, .8680,
	.9308, .9700, .9913,1.0000,1.0009, .9961, .9866, .9715,
	.9498, .9209, .8851, .8446, .8022, .7614, .7241, .6860,
	.6423, .5915, .5326, .4637, .3846, .3042, .2317, .1698,
	.1195, .0814, .0553, .0381, .0266, .0189, .0137, .0097,
	.0056, .0001, .0000
    };

    static const float wli[7] = { 0.6100, 0.8200, 0.4500, 0.5400, 1.2150, 1.6000, 2.0575 };
    static const float wls[7] = { 0.6850, 0.9025, 0.4825, 0.5700, 1.2700, 1.6650, 2.1825 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 31; i++)	 ffu.s[144+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 34; i++)	 ffu.s[228+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 14; i++)	 ffu.s[80+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 13; i++)	 ffu.s[116+i] = sr4[i];
	break;
    case 5: for(i = 0; i < 23; i++)	 ffu.s[386+i] = sr5[i];
	break;
    case 6: for(i = 0; i < 27; i++)	 ffu.s[540+i] = sr6[i];
	break;
    case 7: for(i = 0; i < 51; i++)	 ffu.s[723+i] = sr7[i];
	break;
    }
}

void IWave::polder(int iwa)
{
    /* band 1 of POLDER (443 mic, polarized channel) */
    static const float sr1[27] = {
	.0003, .0042, .0028, .0036, .0060, .0134, .0430, .1284,
	.3394, .6162, .8056, .9060, .9656, .9968, .9880, .8944,

	.6612, .3880, .1950, .0966, .0512, .0292, .0180, .0122,
	.0040, .0000, .0000 
    };

    /* band 2 of POLDER (490 mic) */
    static const float sr2[46] = {
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
	.0000, .0000, .0000, .0000, .0012, .0014, .0022, .0032,
	.0060, .0116, .0252, .0666, .1932, .4896, .8104, .9414,
	.9544, .9710, .9898, .9544, .6920, .3438, .1466, .0630,
	.0304, .0170, .0102, .0070, .0000, .0000
    };

    /* band 3 of POLDER (565 mic) */
    static const float sr3[26] = {
	.0000, .0016, .0048, .0074, .0130, .0258, .0566, .1368,
	.3294, .6592, .9270, .9946, .9798, .9544, .9262, .8814,
	.7692, .5420, .2814, .1218, .0518, .0244, .0118, .0066,
	.0038, .0000
    };

    /* band 4 of POLDER (670 P1, polarized channel) */
    static const float sr4[30] = {
	.0000, .0000, .0000, .0000, .0010, .0044, .0022, .0140,
	.0176, .0394, .1004, .2476, .5462, .8672, .9902, .9874,
	.9572, .9484, .9264, .8274, .5688, .2828, .1154, .0500,
	.0224, .0186, .0160, .0072, .0000, .0000
    };

    /* band 5 of POLDER (763 mic, oxygen absorption channel) */
    static const float sr5[15] = {
	.0000, .0004, .0046, .0134, .0834, .4148, .8056, .9274,
	.9880, .7488, .2416, .0416, .0094, .0008, .0000
    };

    /* band 6 of POLDER (765 mic, oxygen absorption channel) */
    static const float sr6[53] = {
	.0000, .0000, .0010, .0018, .0010, .0030, .0046, .0080,
	.0096, .0140, .0202, .0300, .0410, .0622, .0958, .1516,
	.2400, .3648, .5174, .6640, .7798, .8494, .8858, .9066,
	.9202, .9374, .9516, .9692, .9886, .9932, .9650, .8684,
	.6836, .4686, .2922, .1724, .1012, .0594, .0360, .0238,
	.0144, .0104, .0088, .0060, .0052, .0046, .0038, .0052,
	.0028, .0022, .0000, .0000, .0000
    };

    /* band 7 of POLDER (865 P1, polarized channel) */
    static const float sr7[45] = {
	.0000, .0004, .0008, .0024, .0030, .0056, .0102, .0186,
	.0338, .0622, .1110, .1974, .3410, .5432, .7610, .9218,
	.9896, .9936, .9744, .9514, .9352, .9222, .9150, .9094,
	.8954, .8592, .7766, .6354, .4604, .3006, .1838, .1082,
	.0626, .0346, .0198, .0112, .0064, .0038, .0028, .0016,
	.0014, .0006, .0000, .0000, .0000
    };

    /* band 8 of POLDER (910 mic, water vapor absorption channel) */
    static const float sr8[31] = {
	.0000, .0000, .0000, .0012, .0016, .0018, .0032, .0046,
	.0082, .0158, .0354, .0876, .2242, .5142, .8436, .9848,
	.9838, .9534, .9254, .9084, .8560, .6444, .3388, .1424,
	.0566, .0238, .0098, .0000, .0000, .0000, .0000
    };

    static const float wli[8] = { 0.4125, 0.4100, 0.5325, 0.6300, 0.7450, 0.7000, 0.8100, 0.8650 };
    static const float wls[8] = { 0.4775, 0.5225, 0.5950, 0.7025, 0.7800, 0.8300, 0.9200, 0.9400 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 27; i++)	 ffu.s[65+i] = sr1[i];
	break;
    case 2: for(i = 0; i < 46; i++)	 ffu.s[64+i] = sr2[i];
	break;
    case 3: for(i = 0; i < 26; i++)	 ffu.s[113+i] = sr3[i];
	break;
    case 4: for(i = 0; i < 30; i++)	 ffu.s[152+i] = sr4[i];
	break;
    case 5: for(i = 0; i < 15; i++)	 ffu.s[198+i] = sr5[i];
	break;
    case 6: for(i = 0; i < 53; i++)	 ffu.s[180+i] = sr6[i];
	break;
    case 7: for(i = 0; i < 45; i++)	 ffu.s[224+i] = sr7[i];
	break;
    case 8: for(i = 0; i < 31; i++)	 ffu.s[246+i] = sr8[i];
	break;
    }
}

void IWave::etmplus(int iwa)
{
    /* Spectral filter data found on the following page:
       http://ltpwww.gsfc.nasa.gov/IAS/handbook/handbook_toc.html
    */
    /* 1st spectral band of enhanced thematic mapper plus */
    static const float sr1[36] = {
        .0000, .0160, .0710, .2870, .6665, .7920, .8570, .8390,
        .8060, .7790, .8460, .9010, .8995, .8900, .8510, .8750,
        .8930, .8840, .9300, .9580, .9540, .9800, .9750, .9650,
        .9625, .9950, .9900, .9900, .9795, .9830, .9685, .9600,
        .7685, .2930, .0545, .0090
    };

    /* 2nd spectral band of enhanced thematic mapper plus */
    static const float sr2[52] = {
        .0000, .0006, .0015, .0030, .0118, .0260, .0740, .1740,
        .3480, .5520, .6960, .7590, .7845, .8220, .8695, .9050,
        .9285, .9470, .9525, .9520, .9515, .9530, .9500, .9540,
        .9670, .9590, .9405, .9330, .9385, .9510, .9565, .9550,
        .9560, .9730, .9915, 1.0000, .9760, .9420, .9300, .9120,
        .7985, .5740, .3400, .1850, .1055, .0620, .0375, .0210,
        .0109, .0048, .0022, .0000
    };

    /* 3rd spectral band of enhanced thematic mapper plus */
    static const float sr3[39] = {
        .0000, .0000, .0001, .0005, .0020, .0095, .0470, .1740,
        .4190, .7310, .9210, .9425, .9370, .9365, .9490, .9645,
        .9730, .9705, .9580, .9550, .9620, .9800, .9930, .9980,
        1.0000, .9955, .9920, .9885, .9770, .9545, .9320, .8805,
        .7290, .4440, .1830, .0660, .0250, .0122, .0000
    };

    /* 4th spectral band of enhanced thematic mapper plus */
    static const float sr4[68] = {
        .0000, .0010, .0199, .0315, .0518, .0690, .1100, .1750,
        .2710, .4020, .5555, .7050, .8120, .8710, .8955, .9080,
        .9180, .9260, .9280, .9300, .9255, .9250, .9280, .9230,
        .9165, .9080, .9035, .9090, .9240, .9460, .9655, .9710,
        .9690, .9670, .9655, .9670, .9605, .9490, .9310, .9250,
        .9295, .9430, .9610, .9850, .9925, .9980, .9915, .9940,
        .9970, .9980, .9995, .9910, .9880, .9690, .9265, .8680,
        .8175, .8190, .8800, .8540, .5725, .2560, .1035, .0440,
        .0220, .0110, .0071, .0000
    };

    /* 5th spectral band of enhanced thematic mapper plus */
    static const float sr5[114] = {
        .0060, .0060, .0120, .0060, .0135, .0210, .0400, .0530,
        .0760, .1028, .1480, .2052, .2740, .3660, .4620, .5138,
        .5780, .6250, .6670, .7090, .7370, .7710, .8080, .8315,
        .8590, .8750, .8930, .9012, .8960, .8952, .8945, .8878,
        .8760, .8685, .8725, .8772, .8740, .8605, .8680, .8785,
        .8990, .8940, .9000, .9020, .9190, .9248, .9290, .9455,
        .9475, .9532, .9520, .9667, .9610, .9597, .9780, .9587,
        .9535, .9512, .9517, .9550, .9440, .9345, .9305, .9385,
        .9480, .9397, .9385, .9470, .9450, .9450, .9553, .9647,
        .9690, .9732, .9910, .9960, .9975, .9945, 1.0000, .9912,
        .9865, .9885, .9895, .9875, .9810, .9812, .9780, .9685,
        .9600, .9383, .9020, .8545, .7910, .6927, .6077, .5258,
        .4275, .3420, .2670, .2027, .1585, .1187, .0840, .0722,
        .0535, .0438, .0390, .0305, .0205, .0217, .0110, .0100,
        .0060, .0079
    };

    /* 7th spectral band of enhanced thematic mapper plus */
    static const float sr6[155] = {
        .0029, .0030, .0023, .0030, .0008, .0020, .0040, .0020,
        .0020, .0120, .0085, .0090, .0178, .0170, .0312, .0370,
        .0457, .0580, .0762, .0880, .1098, .1490, .1960, .2420,
        .3030, .3670, .4367, .5190, .6100, .6765, .7183, .7560,
        .7738, .7840, .7755, .7890, .7818, .7780, .7665, .7615,
        .7680, .7750, .7690, .7880, .8085, .7940, .8230, .8115,
        .8195, .8365, .8370, .8360, .8512, .8585, .8552, .8710,
        .8735, .8750, .8590, .8715, .8592, .8720, .8625, .8650,
        .8680, .8765, .8730, .8690, .8760, .8680, .8792, .8735,
        .8760, .8800, .8745, .8700, .8578, .8630, .8585, .8440,
        .8585, .8545, .8625, .8680, .8560, .8470, .8612, .8510,
        .8520, .8380, .8465, .8403, .8305, .8355, .8382, .8220,
        .8380, .8385, .8425, .8535, .8622, .8730, .8680, .8790,
        .8908, .8980, .9195, .9200, .9263, .9275, .9340, .9360,
        .9532, .9540, .9517, .9600, .9728, .9850, .9720, .9700,
        .9938, .9895, .9748, 1.0000, .9912, .9680, .9657, .9555,
        .9295, .9290, .9255, .9030, .9235, .9290, .9285, .9200,
        .8532, .7750, .6588, .5315, .4035, .2750, .2175, .1310,
        .1035, .0750, .0518, .0290, .0290, .0155, .0192, .0130,
        .0065, .0150, .0022
    };

    /* 8th spectral band of enhanced thematic mapper plus (Pan) */
    static const float sr7[175] = {
        .0000, .0000, .0027, .0175, .0563, .1500, .3285, .5015,
        .5845, .5990, .6018, .6095, .6142, .6100, .6035, .6035,
        .6118, .6270, .6385, .6445, .6438, .6320, .6260, .6245,
        .6320, .6420, .6593, .6775, .6897, .6970, .7005, .7050,
        .7110, .7130, .7165, .7180, .7120, .7070, .7040, .7030,
        .7147, .7300, .7440, .7535, .7615, .7640, .7532, .7450,
        .7352, .7290, .7285, .7310, .7328, .7340, .7435, .7495,
        .7540, .7580, .7617, .7680, .7720, .7790, .7815, .7850,
        .7900, .7930, .7917, .7915, .7950, .7980, .8017, .8060,
        .8133, .8200, .8275, .8315, .8370, .8420, .8485, .8545,
        .8605, .8680, .8722, .8795, .8852, .8920, .8945, .8960,
        .8945, .8940, .8942, .8955, .8975, .9000, .9032, .9035,
        .9022, .9000, .8967, .8935, .8827, .8790, .8782, .8730,
        .8760, .8800, .8812, .8865, .8910, .8930, .9035, .9105,
        .9183, .9200, .9175, .9160, .9183, .9180, .9167, .9155,
        .9173, .9270, .9290, .9375, .9497, .9570, .9637, .9695,
        .9715, .9770, .9795, .9840, .9908, .9970, .9985, .9980,
        .9952, .9940, .9920, .9930, .9925, .9870, .9755, .9650,
        .9583, .9490, .9347, .9240, .9133, .9070, .9052, .9085,
        .9193, .9400, .9657, .9780, .9625, .8950, .7520, .5715,
        .3962, .2580, .1675, .1080, .0688, .0440, .0297, .0195,
        .0130, .0080, .0055, .0035, .0023, .0020, .0010
    };

    static const float wli[7] = {0.4325, 0.4975, 0.6100, 0.7475, 1.5100, 1.9975, 0.4975};
    static const float wls[7] = {0.5225, 0.6275, 0.7075, 0.9175, 1.7950, 2.3850, 0.9350};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 36; i++)  ffu.s[73+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 52; i++)  ffu.s[99+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 39; i++)  ffu.s[144+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 68; i++)  ffu.s[199+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 114; i++)  ffu.s[504+i] = sr5[i];
        break;
    case 6: for(i = 0; i < 155; i++)  ffu.s[699+i] = sr6[i];
        break;
    case 7: for(i = 0; i < 175; i++)  ffu.s[99+i] = sr7[i];
        break;
    }
}

double IWave::solirr(const double fwl) const
{
/*    si (in w/m2/micron) contains the values of the solar
      irradiance between 0.25 and 4.0 microns, by step of 0.0025 m.
      the value of the total irradiance is 1372 w/m2 on the whole
      spectrum (1358 w/m2 between 0.25 and 4.0 microns) */

    static const float si[1501] = {
        69.30,  77.65,  86.00, 100.06, 114.12, 137.06, 160.00,
	169.52, 179.04, 178.02, 177.00, 193.69, 210.38, 241.69,
	273.00, 318.42, 363.84, 434.42, 505.00, 531.50, 558.00,
	547.50, 537.00, 559.02, 581.03, 619.52, 658.00, 694.39,
	730.78, 774.39, 817.99, 871.99, 925.99, 912.04, 898.09,
	920.69, 943.29, 925.99, 908.69, 936.09, 963.49, 994.94,
	1026.39, 980.74, 935.09,1036.29,1137.49,1163.74,1189.99,
	1109.34,1028.69,1088.99,1149.29,1033.69, 918.09,1031.89,
	1145.69,1035.09, 924.49,1269.29,1614.09,1631.09,1648.09,
	1677.19,1706.29,1744.89,1783.49,1750.19,1716.89,1705.19,
	1693.49,1597.69,1501.89,1630.99,1760.09,1775.24,1790.39,
	1859.94,1929.49,1993.44,2057.39,2039.23,2021.08,2030.73,
	2040.38,2026.53,2012.68,1999.53,1986.38,2002.88,2019.38,
	2038.09,2056.79,1967.74,1878.68,1905.83,1932.98,1953.58,
	1974.18,1935.68,1897.19,1916.78,1936.38,1937.23,1938.09,
	1881.44,1824.79,1814.09,1803.39,1832.24,1861.09,1885.93,
	1910.78,1904.68,1898.58,1875.73,1852.88,1865.64,1878.39,
	1874.74,1871.09,1872.44,1873.79,1850.39,1826.99,1837.04,
	1847.09,1841.18,1835.28,1849.48,1863.69,1851.03,1838.38,
	1840.73,1843.08,1802.83,1762.58,1778.78,1794.99,1777.48,
	1759.98,1764.73,1769.49,1753.48,1737.48,1713.14,1688.80,
	1702.88,1716.97,1696.07,1675.17,1672.03,1668.89,1663.56,
	1658.23,1647.75,1637.27,1630.02,1622.77,1606.06,1589.36,
	1552.29,1515.22,1528.91,1542.60,1548.90,1555.21,1544.41,
	1533.62,1525.24,1516.86,1507.92,1498.98,1484.07,1469.17,
	1464.28,1459.39,1448.73,1438.08,1423.16,1408.24,1407.53,
	1406.82,1397.82,1388.82,1378.51,1368.21,1352.13,1336.05,
	1343.88,1351.71,1339.60,1327.50,1320.72,1313.94,1294.94,
	1275.94,1280.92,1285.90,1278.04,1270.19,1263.68,1257.18,
	1249.80,1242.41,1231.30,1220.19,1212.14,1204.10,1201.69,
	1199.29,1194.78,1190.27,1185.47,1180.68,1174.38,1168.09,
	1156.17,1144.26,1143.46,1142.67,1132.95,1123.23,1116.71,
	1110.19,1110.89,1111.59,1094.80,1078.01,1077.75,1077.49,
	1073.89,1070.29,1058.71,1047.13,1045.66,1044.20,1037.03,
	1029.86,1010.40, 990.94, 966.91, 942.89, 972.87,1002.86,
	978.93, 955.00, 960.95, 966.91, 983.31, 999.71, 991.91,
	984.11, 979.05, 973.99, 968.79, 963.60, 958.23, 952.87,
	947.93, 942.99, 937.99, 933.00, 928.00, 923.00, 918.18,
	913.37, 908.74, 904.11, 899.05, 893.99, 889.18, 884.37,
	879.74, 875.12, 870.24, 865.36, 860.94, 856.53, 852.02,
	847.50, 843.00, 838.50, 833.99, 829.49, 824.98, 820.48,
	815.99, 811.50, 806.99, 802.49, 798.17, 793.86, 789.74,
	785.63, 781.25, 776.87, 772.92, 768.98, 764.80, 760.63,
	756.06, 751.49, 746.99, 742.49, 738.18, 733.88, 729.76,
	725.63, 721.24, 716.86, 712.92, 708.99, 704.81, 700.63,
	696.25, 691.87, 687.94, 684.01, 680.01, 676.00, 671.80,
	667.61, 663.23, 658.86, 655.32, 651.77, 649.07, 646.37,
	643.74, 641.11, 638.05, 634.99, 632.18, 629.37, 626.74,
	624.12, 621.06, 618.00, 615.18, 612.37, 609.92, 607.48,
	604.79, 602.11, 599.24, 596.38, 593.93, 591.48, 588.79,
	586.11, 583.25, 580.40, 577.94, 575.48, 572.99, 570.51,
	568.00, 565.49, 562.98, 560.47, 557.98, 555.50, 553.01,
	550.51, 548.00, 545.49, 542.98, 540.48, 537.98, 535.49,
	533.19, 530.90, 528.94, 526.99, 524.80, 522.62, 520.24,
	517.87, 515.44, 513.01, 509.59, 506.17, 502.89, 499.62,
	496.35, 493.09, 489.81, 486.54, 483.27, 480.01, 476.73,
	473.46, 470.19, 466.92, 463.64, 460.37, 457.10, 453.84,
	450.57, 447.30, 444.03, 440.76, 437.48, 434.21, 430.94,
	427.67, 424.40, 421.13, 417.86, 414.59, 411.32, 408.05,
	404.78, 401.51, 398.24, 394.97, 391.70, 388.43, 392.57,
	396.71, 401.92, 407.14, 405.32, 403.50, 401.67, 399.84,
	398.02, 396.21, 394.37, 392.54, 390.72, 388.90, 387.06,
	385.23, 383.42, 381.60, 379.77, 377.95, 376.12, 374.30,
	372.48, 370.66, 368.82, 366.99, 365.17, 363.35, 361.52,
	359.69, 357.87, 356.05, 354.22, 352.39, 350.57, 348.75,
	346.92, 345.10, 343.27, 341.45, 341.84, 342.24, 342.95,
	343.66, 342.27, 340.89, 339.49, 338.09, 336.69, 335.30,
	333.91, 332.53, 331.13, 329.73, 328.34, 326.96, 325.56,
	324.16, 322.77, 321.39, 319.99, 318.59, 317.20, 315.82,
	314.42, 313.03, 311.63, 310.24, 308.85, 307.46, 306.06,
	304.66, 303.28, 301.90, 300.50, 299.10, 297.71, 296.32,
	294.93, 293.54, 293.41, 293.28, 293.35, 293.42, 292.26,
	291.10, 289.97, 288.84, 287.69, 286.54, 285.39, 284.25,
	283.10, 281.96, 280.81, 279.67, 278.52, 277.38, 276.23,
	275.08, 273.94, 272.80, 271.65, 270.51, 269.36, 268.22,
	267.07, 265.93, 264.78, 263.64, 262.49, 261.34, 260.20,
	259.06, 257.91, 256.77, 255.62, 254.47, 253.33, 252.20,
	251.16, 250.13, 249.11, 248.09, 246.97, 245.86, 244.74,
	243.61, 242.49, 241.37, 240.24, 239.12, 238.00, 236.89,
	235.76, 234.64, 233.51, 232.38, 231.26, 230.13, 229.01,
	227.90, 226.77, 225.65, 224.53, 223.42, 222.29, 221.16,
	220.04, 218.92, 217.80, 216.68, 215.55, 214.43, 213.30,
	212.18, 211.06, 209.94, 208.82, 207.69, 206.99, 206.29,
	205.65, 205.02, 203.98, 202.95, 201.90, 200.85, 199.81,
	198.78, 197.74, 196.70, 195.65, 194.61, 193.57, 192.54,
	191.50, 190.47, 189.42, 188.37, 187.33, 186.30, 185.26,
	184.22, 183.18, 182.14, 181.10, 180.06, 179.02, 177.98,
	176.93, 175.89, 174.86, 173.83, 172.78, 171.73, 170.70,
	169.67, 168.62, 167.57, 167.59, 167.60, 167.76, 167.93,
	167.09, 166.26, 165.42, 164.58, 163.75, 162.92, 162.08,
	161.25, 160.41, 159.58, 158.74, 157.91, 157.07, 156.24,
	155.40, 154.57, 153.73, 152.90, 152.06, 151.23, 150.39,
	149.56, 148.72, 147.89, 147.06, 146.23, 145.39, 144.55,
	143.71, 142.88, 142.05, 141.22, 140.38, 139.54, 138.70,
	137.86, 137.99, 138.11, 138.36, 138.60, 137.94, 137.29,
	136.64, 136.00, 135.35, 134.71, 134.05, 133.39, 132.74,
	132.09, 131.45, 130.81, 130.15, 129.49, 128.84, 128.20,
	127.55, 126.90, 126.25, 125.60, 124.94, 124.29, 123.64,
	123.00, 122.35, 121.70, 121.05, 120.40, 119.74, 119.09,
	118.45, 117.81, 117.15, 116.50, 115.85, 115.19, 115.25,
	115.31, 115.46, 115.62, 115.11, 114.60, 114.09, 113.58,
	113.06, 112.54, 112.03, 111.53, 111.01, 110.50, 109.99,
	109.47, 108.95, 108.44, 107.93, 107.42, 106.92, 106.42,
	105.89, 105.37, 104.85, 104.34, 103.83, 103.33, 102.81,
	102.29, 101.79, 101.29, 100.77, 100.25,  99.74,  99.22,
        98.71,  98.20,  97.69,  97.18,  97.12,  97.07,  97.09,
        97.11,  96.68,  96.26,  95.84,  95.42,  94.99,  94.56,
        94.14,  93.72,  93.31,  92.89,  92.46,  92.03,  91.61,
        91.19,  90.76,  90.34,  89.92,  89.49,  89.07,  88.66,
        88.24,  87.81,  87.39,  86.97,  86.55,  86.12,  85.69,
        85.26,  84.85,  84.43,  84.01,  83.59,  83.17,  82.75,
        82.32,  81.89,  81.89,  81.89,  81.95,  82.02,  81.68,
        81.35,  81.00,  80.65,  80.32,  79.99,  79.64,  79.30,
        78.96,  78.61,  78.27,  77.94,  77.60,  77.26,  76.91,
        76.57,  76.24,  75.90,  75.56,  75.22,  74.88,  74.54,
        74.20,  73.86,  73.52,  73.18,  72.84,  72.50,  72.16,
        71.82,  71.48,  71.14,  70.80,  70.47,  70.13,  69.79,
        69.76,  69.73,  69.76,  69.80,  69.52,  69.24,  68.96,
        68.68,  68.41,  68.14,  67.85,  67.57,  67.29,  67.02,
        66.75,  66.48,  66.19,  65.90,  65.63,  65.36,  65.08,
        64.80,  64.53,  64.25,  63.97,  63.69,  63.41,  63.14,
        62.85,  62.57,  62.30,  62.03,  61.75,  61.47,  61.19,
        60.92,  60.64,  60.36,  60.08,  59.81,  59.80,  59.80,
        59.82,  59.85,  59.63,  59.40,  59.17,  58.95,  58.73,
        58.50,  58.28,  58.06,  57.83,  57.60,  57.37,  57.15,
        56.93,  56.70,  56.48,  56.26,  56.03,  55.79,  55.57,
        55.36,  55.13,  54.90,  54.66,  54.43,  54.22,  54.00,
        53.77,  53.55,  53.32,  53.09,  52.87,  52.65,  52.43,
        52.20,  51.97,  51.75,  51.72,  51.68,  51.67,  51.67,
        51.48,  51.30,  51.11,  50.92,  50.73,  50.55,  50.37,
        50.18,  49.98,  49.79,  49.61,  49.43,  49.23,  49.04,
        48.85,  48.67,  48.48,  48.30,  48.12,  47.93,  47.73,
        47.54,  47.36,  47.18,  46.98,  46.79,  46.60,  46.42,
        46.24,  46.06,  45.87,  45.67,  45.48,  45.30,  45.12,
        44.93,  44.87,  44.82,  44.80,  44.79,  44.62,  44.45,
        44.29,  44.14,  43.98,  43.83,  43.66,  43.49,  43.34,
        43.18,  43.02,  42.86,  42.70,  42.55,  42.38,  42.21,
        42.06,  41.90,  41.74,  41.58,  41.42,  41.26,  41.10,
        40.94,  40.78,  40.62,  40.46,  40.31,  40.14,  39.97,
        39.81,  39.66,  39.50,  39.34,  39.18,  39.03,  38.99,
        38.96,  38.94,  38.92,  38.79,  38.66,  38.52,  38.38,
        38.25,  38.12,  37.99,  37.86,  37.72,  37.58,  37.44,
        37.30,  37.17,  37.05,  36.91,  36.77,  36.64,  36.50,
        36.36,  36.23,  36.09,  35.96,  35.82,  35.69,  35.55,
        35.42,  35.28,  35.15,  35.01,  34.88,  34.75,  34.61,
        34.47,  34.34,  34.20,  34.07,  34.05,  34.03,  34.03,
        34.03,  33.91,  33.79,  33.68,  33.57,  33.46,  33.35,
        33.23,  33.12,  33.01,  32.90,  32.78,  32.67,  32.55,
        32.44,  32.33,  32.23,  32.11,  32.00,  31.89,  31.77,
        31.66,  31.55,  31.43,  31.31,  31.20,  31.10,  30.99,
        30.87,  30.76,  30.66,  30.54,  30.42,  30.31,  30.20,
        30.08,  29.97,  29.93,  29.90,  29.88,  29.87,  29.76,
        29.66,  29.56,  29.46,  29.36,  29.27,  29.17,  29.08,
        28.98,  28.88,  28.77,  28.67,  28.58,  28.49,  28.39,
        28.30,  28.20,  28.10,  28.00,  27.91,  27.81,  27.71,
        27.61,  27.52,  27.41,  27.31,  27.21,  27.12,  27.03,
        26.93,  26.83,  26.74,  26.64,  26.54,  26.44,  26.35,
        26.33,  26.31,  26.29,  26.28,  26.20,  26.12,  26.04,
        25.95,  25.87,  25.79,  25.71,  25.64,  25.54,  25.45,
        25.37,  25.30,  25.21,  25.12,  25.05,  24.98,  24.89,
        24.80,  24.71,  24.63,  24.55,  24.47,  24.39,  24.31,
        24.22,  24.14,  24.05,  23.97,  23.89,  23.81,  23.73,
        23.66,  23.56,  23.47,  23.39,  23.31,  23.28,  23.26,
        23.23,  23.21,  23.13,  23.06,  22.99,  22.92,  22.84,
        22.76,  22.69,  22.63,  22.55,  22.47,  22.41,  22.35,
        22.27,  22.19,  22.11,  22.04,  21.97,  21.90,  21.83,
        21.76,  21.68,  21.60,  21.53,  21.47,  21.39,  21.31,
        21.24,  21.18,  21.11,  21.03,  20.96,  20.89,  20.81,
        20.73,  20.66,  20.60,  20.57,  20.55,  20.54,  20.53,
        20.46,  20.40,  20.34,  20.28,  20.21,  20.14,  20.08,
        20.03,  19.96,  19.90,  19.83,  19.77,  19.71,  19.65,
        19.59,  19.53,  19.46,  19.39,  19.33,  19.27,  19.21,
        19.15,  19.08,  19.02,  18.96,  18.90,  18.84,  18.78,
        18.71,  18.64,  18.58,  18.53,  18.46,  18.40,  18.33,
        18.27,  18.26,  18.25,  18.24,  18.24,  18.19,  18.14,
        18.08,  18.03,  17.98,  17.93,  17.88,  17.83,  17.77,
        17.71,  17.66,  17.62,  17.56,  17.50,  17.45,  17.41,
        17.35,  17.29,  17.25,  17.21,  17.14,  17.08,  17.04,
        17.00,  16.93,  16.87,  16.83,  16.79,  16.72,  16.66,
        16.61,  16.57,  16.51,  16.46,  16.41,  16.36,  16.34,
        16.33,  16.31,  16.30,  16.26,  16.22,  16.17,  16.13,
        16.08,  16.04,  16.00,  15.96,  15.90,  15.84,  15.81,
        15.78,  15.73,  15.68,  15.63,  15.59,  15.55,  15.50,
        15.45,  15.40,  15.36,  15.32,  15.28,  15.24,  15.18,
        15.13,  15.09,  15.05,  15.01,  14.96,  14.91,  14.87,
        14.82,  14.78,  14.73,  14.69,  14.66,  14.64,  14.64,
        14.63,  14.59,  14.55,  14.50,  14.45,  14.41,  14.38,
        14.35,  14.32,  14.26,  14.21,  14.18,  14.15,  14.10,
        14.05,  14.01,  13.98,  13.94,  13.91,  13.86,  13.82,
        13.78,  13.74,  13.70,  13.67,  13.62,  13.58,  13.54,
        13.50,  13.46,  13.43,  13.39,  13.35,  13.30,  13.25,
        13.22,  13.18,  13.17,  13.16,  13.14,  13.12,  13.09,
        13.06,  13.03,  13.00,  12.96,  12.92,  12.89,  12.85,
        12.81,  12.78,  12.74,  12.70,  12.67,  12.65,  12.61,
        12.57,  12.53,  12.50,  12.46,  12.43,  12.39,  12.36,
        12.32,  12.28,  12.25,  12.22,  12.18,  12.15,  12.11,
        12.07,  12.04,  12.01,  11.97,  11.94,  11.90,  11.86,
        11.85,  11.85,  11.85,  11.84,  11.81,  11.78,  11.75,
        11.72,  11.69,  11.66,  11.63,  11.60,  11.58,  11.55,
        11.51,  11.47,  11.45,  11.42,  11.39,  11.36,  11.33,
        11.30,  11.27,  11.24,  11.21,  11.18,  11.15,  11.12,
        11.09,  11.06,  11.03,  11.00,  10.97,  10.94,  10.91,
        10.89,  10.85,  10.82,  10.78,  10.75,  10.73,  10.72,
        10.71,  10.70,  10.67,  10.64,  10.62,  10.59,  10.55,
        10.52,  10.50,  10.47,  10.44,  10.42,  10.39,  10.37,
        10.34,  10.31,  10.28,  10.25,  10.22,  10.20,  10.17,
        10.15,  10.12,  10.10,  10.06,  10.03,  10.00,   9.98,
	9.95,   9.92,   9.89,   9.86,   9.84,   9.82,   9.79,
	9.75,   9.73,   9.71,   9.70,   9.70,   9.70,   9.70,
	9.67,   9.63,   9.61,   9.59,   9.58,   9.56,   9.53,
	9.50,   9.48,   9.45,   9.43,   9.41,   9.39,   9.36,
	9.34,   9.32,   9.30,   9.27,   9.24,   9.22,   9.20,
	9.18,   9.15,   9.13,   9.11,   9.08,   9.06,   9.05,
	9.02,   8.99,   8.96,   8.94,   8.92,   8.90,   8.87,
	8.85,   8.83,   8.81
    };

    double pas = 0.0025;
    int   iwl = (int)((fwl - 0.250) / pas + 1.5);
	  
    if(iwl >= 0) return si[iwl-1];

    cout << " wavelength  less  than  0.25  micron: " << endl << " let's take s(l)=s(0.25)" << endl;
    return si[0];
}

void IWave::irs_1c_liss(int iwa)
{
    /* 2nd spectral band of IRS 1C LISS III */
    static const float sr2[61] = {
	.0006, .0009, .0012, .0020, .0036, .0080, .0216, .0655,
	.1690, .3080, .4280, .5600, .7010, .7600, .7640, .7690,
	.7960, .8400, .8760, .8820, .8670, .8560, .8620, .8890,
	.9240, .9480, .9590, .9540, .9460, .9490, .9660, .9860,
	1.0000,.9960, .9740, .9490, .9340, .9340, .9340, .9210,
	.8820, .8300, .7880, .7770, .7670, .6640, .4190, .1980,
	.0882, .0396, .0192, .0107, .0066, .0041, .0026, .0018,
	.0012, .0010, .0007, .0006
    };

    /* 3rd spectral band of IRS 1C LISS III */
    static const float sr3[45] = { 
	.0041, .0110, .0357, .1310, .4020, .7200, .8300, .8700,
	.8980, .9120, .9230, .9300, .9320, .9310, .9270, .9300,
	.9390, .9510, .9580, .9600, .9630, .9700, .9890,1.0000,
	.9880, .9390, .8740, .8220, .8040, .8350, .9000, .9620,
	.9730, .9410, .9170, .8790, .6460, .2940, .1050, .0390,
	.0105, .0040, .0020, .0010, .0000
    };

    /* 4th spectral band of IRS 1C LISS III */
    static const float sr4[65] = {  
	.0090, .0149, .0244, .0400, .0649, .1020, .1520, .2170,
	.2940, .3820, .4830, .6120, .7270, .8320, .9180, .9760,
	1.0000,.9970, .9800, .9590, .9410, .9330, .9330, .9390,
	.9480, .9550, .9620, .9580, .9500, .9380, .9270, .9150,
	.9100, .9050, .9050, .9020, .8970, .8900, .8830, .8740,
	.8690, .8700, .8720, .8740, .8680, .8490, .8150, .7720,
	.7310, .6990, .6840, .6800, .6640, .5750, .4060, .2280,
	.1240, .0641, .0356, .0206, .0126, .0080, .0052, .0035,
	.0025
    };
	 
    /* 5th spectral band of IRS 1C LISS III */
    static const float sr5[155] = { 
	.0000, .0000, .0000, .0000, .0001, .0001, .0001, .0001,
	.0000, .0001, .0001, .0021, .0001, .0000, .0001, .0001,
	.0001, .0001, .0001, .0002, .0002, .0002, .0001, .0005,
	.0004, .0006, .0007, .0010, .0011, .0015, .0020, .0024,
	.0030, .0039, .0051, .0068, .0088, .0114, .0153, .0206,
	.0281, .0372, .0515, .0708, .0983, .1370, .1870, .2580,
	.3470, .4410, .5340, .6190, .6920, .7510, .7940, .8270,
	.8500, .8680, .8800, .8920, .9010, .9090, .9170, .9250,
	.9310, .9400, .9490, .9590, .9700, .9760, .9850, .9920,
	.9960,1.0000,1.0000, .9960, .9910, .9860, .9790, .9730,
	.9680, .9660, .9620, .9640, .9670, .9700, .9750, .9810,
	.9850, .9880, .9840, .9770, .9690, .9560, .9400, .9240,
	.9080, .8880, .8710, .8570, .8410, .8300, .8220, .8180,
	.8170, .8220, .8290, .8370, .8460, .8550, .8450, .8310,
	.8110, .7870, .7580, .7180, .6780, .6380, .5990, .5640,
	.5280, .4930, .4590, .4210, .3770, .3320, .2770, .2160,
	.1580, .1110, .0772, .0528, .0357, .0242, .0165, .0117,
	.0083, .0059, .0042, .0031, .0023, .0017, .0013, .0009,
	.0007, .0005, .0004, .0002, .0002, .0001, .0001, .0001,
	.0001, .0000, .0000
    };

    static const float wli[4] = { 0.502, 0.612, 0.752, 1.452 };
    static const float wls[4] = { 0.620, 0.700, 0.880, 1.760 };

    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 

    switch(iwa)
    {
    case 1: for(i = 0; i < 61; i++)	 ffu.s[101+i] = sr2[i];
	break;
    case 2: for(i = 0; i < 45; i++)	 ffu.s[145+i] = sr3[i];
	break;
    case 3: for(i = 0; i < 65; i++)	 ffu.s[201+i] = sr4[i];
	break;
    case 4: for(i = 0; i < 155; i++)	 ffu.s[481+i] = sr5[i];
	break;
    }
}

void IWave::aster(int iwa)
{
    /* Spectral filter data found on the following page:
	 http://www.science.aster.ersdac.or.jp/en/about_aster/sensor/
	 */
    /* Band 1 of Aster; Central Wavelength = 556nm */
    static const float sr1[67] = {
		.0000, .0054, .0073, .0078, .0076, .0074, .0093, .0217,
		.0580, .0947, .1566, .2694, .3712, .4813, .6204, .7414,
		.8392, .9077, .9552, .9878, .9973, .9992, .9781, .9373,
		.8900, .8784, .8786, .8941, .8993, .9049, .9231, .9238,
		.9184, .9301, .9423, .9493, .9522, .9548, .9598, .9593,
		.9528, .9256, .8967, .8748, .8265, .7625, .7065, .6282,
		.5206, .3775, .2535, .1629, .1168, .0859, .0593, .0451,
		.0355, .0174, .0078, .0049, .0040, .0038, .0053, .0052,
		.0037, .0023, .0000
    };
	
    /* Band 2 of Aster; Central Wavelength = 659nm  */
    static const float sr2[59] = {
		.0000, .0038, .0034, .0008, .0008, .0024, .0029, .0006,
		.0047, .0050, .0033, .0049, .0126, .0000, .1220, .2738,
		.4703, .6723, .8350, .9709, .9990, .9835, .9715, .9710,
		.9734, .9430, .9095, .9305, .9418, .9386, .9202, .9100,
		.8973, .8606, .8195, .7986, .7889, .7702, .7538, .6961,
		.6087, .5186, .4523, .4258, .3811, .3244, .2591, .1854,
		.1121, .0623, .0469, .0334, .0181, .0112, .0010, .0054,
		.0044, .0017, .0000
    };
	
    /* Band 3N (N=Nadir pointing) of Aster; Central Wavelength = 807nm  */
    static const float sr3[77] = {
		.0000, .0017, .0078, .0167, .0285, .0447, .0492, .0509,
		.0744, .1160, .1768, .2527, .3625, .5534, .8008,1.0000,
		.9903, .9613, .9012, .9032, .9197, .9655, .9868, .9942,
		.9857, .9745, .9648, .9465, .9368, .9634, .9760, .9820,
		.9938, .9968, .9908, .9810, .9756, .9855, .9832, .9694,
		.9587, .9527, .9499, .9357, .9263, .9552, .9579, .9489,
		.9447, .9399, .9322, .8945, .8220, .7353, .6193, .4813,
		.3584, .2614, .1890, .1269, .0841, .0618, .0442, .0318,
		.0277, .0245, .0213, .0130, .0075, .0074, .0068, .0049,
		.0030, .0024, .0024, .0017, .0000
    };
	
    /* Band 4 of Aster; Central Wavelength = 1657nm  */
    static const float sr4[89] = {
		.0000, .0001, .0001, .0002, .0004, .0005, .0007, .0009,
		.0012, .0014, .0017, .0021, .0024, .0028, .0032, .0036,
		.0040, .0045, .0054, .0065, .0080, .0112, .0170, .0245,
		.0330, .0450, .0740, .0990, .1520, .2140, .3050, .4200,
		.5970, .6750, .7900, .8270, .8400, .8408, .9010, .9050,
		.9100, .9140, .9050, .9260, .9470, .9670, .9760, .9840,
		.9710, .9790, .9880,1.0000, .9902, .9840, .9780, .9710,
		.9470, .9510, .9450, .9380, .9340, .9300, .9360, .9420,
		.9140, .8970, .7980, .7000, .5970, .4610, .3700, .2630,
		.1730, .1259, .0888, .0619, .0450, .0346, .0267, .0207,
		.0160, .0120, .0086, .0060, .0040, .0025, .0013, .0003,
		.0000
    };
	
    /* Band 5 of Aster; Central Wavelength = 2169nm  */
    static const float sr5[74] = {
		.0000, .0001, .0007, .0017, .0030, .0045, .0062, .0080,
		.0100, .0124, .0157, .0200, .0290, .0410, .0780, .1310,
		.2050, .3030, .5410, .7050, .7790, .7910, .8030, .8220,
		.8400, .9180, .9590,1.0000, .9750, .9020, .7790, .6890,
		.5900, .4180, .3030, .2300, .1720, .1070, .0700, .0610,
		.0498, .0385, .0273, .0160, .0140, .0120, .0100, .0080,
		.0070, .0060, .0050, .0040, .0038, .0036, .0034, .0033,
		.0031, .0029, .0027, .0025, .0024, .0023, .0021, .0020,
		.0019, .0017, .0016, .0015, .0013, .0011, .0008, .0005,
		.0002, .0000
    };
	
    /* Band 6 of Aster; Central Wavelength = 2209nm  */
    static const float sr6[78] = {
		.0000, .0001, .0001, .0003, .0005, .0007, .0010, .0014,
		.0018, .0022, .0027, .0032, .0037, .0044, .0050, .0057,
		.0064, .0072, .0080, .0092, .0110, .0133, .0160, .0194,
		.0240, .0298, .0370, .0490, .0660, .1070, .1720, .2540,
		.3520, .5000, .6020, .7420, .7620, .7790, .8520, .8690,
		.8860, .9020, .9290, .9550, .9840,1.0000, .9340, .8200,
		.7540, .5160, .3280, .2380, .1640, .1070, .0570, .0468,
		.0365, .0263, .0160, .0140, .0120, .0100, .0080, .0070,
		.0060, .0050, .0040, .0036, .0032, .0029, .0025, .0022,
		.0018, .0015, .0011, .0006, .0002, .0000
    };
	
    /* Band 7 of Aster; Central Wavelength = 2263nm  */
    static const float sr7[78] = {
		.0000, .0012, .0031, .0054, .0080, .0111, .0149, .0195,
		.0250, .0330, .0490, .0700, .1150, .1760, .2500, .3850,
		.5080, .6560, .7950, .8690, .8480, .9100, .9100, .9260,
		.9260, .9430, .9590, .9750, .9750,1.0000, .9590, .8690,
		.7990, .7050, .6230, .5000, .3930, .3030, .2420, .1760,
		.1270, .1060, .0840, .0625, .0410, .0370, .0330, .0290,
		.0250, .0230, .0215, .0199, .0182, .0165, .0147, .0130,
		.0112, .0093, .0084, .0078, .0074, .0070, .0067, .0062,
		.0058, .0053, .0049, .0044, .0040, .0035, .0031, .0027,
		.0022, .0018, .0013, .0008, .0004, .0000
    };
	
    /* Band 8 of Aster; Central Wavelength = 2334nm  */
    static const float sr8[92] = {
		.0000, .0026, .0055, .0081, .0103, .0120, .0131, .0138,
		.0147, .0160, .0195, .0260, .0347, .0450, .0610, .0820,
		.1060, .1390, .2040, .2860, .4490, .6040, .7020, .8330,
		.9710, .9880, .9550, .9800, .9770, .9750, .9720, .9700,
		.9670, .9470, .9620, .9770, .9920,1.0000, .9800, .9960,
		.9920, .9960, .9550, .9630, .9060, .8370, .7840, .7020,
		.5800, .4410, .3430, .2780, .2200, .1670, .1307, .0996,
		.0747, .0570, .0440, .0332, .0250, .0200, .0171, .0150,
		.0134, .0120, .0108, .0098, .0089, .0080, .0070, .0059,
		.0049, .0040, .0031, .0022, .0015, .0012, .0010, .0009,
		.0008, .0007, .0006, .0005, .0004, .0004, .0003, .0002,
		.0002, .0001, .0001, .0000
    };
	
    /* Band 9 of Aster; Central Wavelength = 2400nm  */
    static const float sr9[98] = {
		.0000, .0004, .0012, .0020, .0028, .0036, .0044, .0053,
		.0062, .0071, .0080, .0089, .0098, .0108, .0120, .0133,
		.0148, .0169, .0200, .0290, .0450, .0650, .0780, .1100,
		.1550, .2290, .3270, .4240, .5390, .7270, .7840, .9060,
		.9270, .8980, .9000, .9010, .9030, .9040, .9060, .9310,
		.9270, .9220, .9610,1.0000, .9800, .9590, .9270, .8940,
		.8690, .8330, .8160, .7670, .7020, .6610, .5630, .4240,
		.3430, .2610, .1920, .1439, .1021, .0695, .0490, .0369,
		.0274, .0205, .0160, .0132, .0111, .0094, .0080, .0066,
		.0053, .0044, .0040, .0051, .0073, .0087, .0088, .0088,
		.0087, .0087, .0086, .0085, .0084, .0082, .0079, .0076,
		.0072, .0067, .0062, .0055, .0047, .0039, .0029, .0018,
		.0005, .0000
    };
	
    static const float wli[9] = { 0.4800, 0.5875, 0.7225, 1.5300, 2.1025, 2.1050, 2.2000, 2.2475, 2.2950 };
    static const float wls[9] = { 0.6450, 0.7325, 0.9125, 1.7500, 2.2850, 2.2975, 2.3925, 2.4750, 2.5375 };
	
    ffu.wlinf = wli[iwa-1];
    ffu.wlsup = wls[iwa-1];
	
    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0; 
	
    switch(iwa)
    {
		case  1: for(i = 0; i <  67; i++)	 ffu.s[92+i] = sr1[i];
			break;
		case  2: for(i = 0; i <  59; i++)	 ffu.s[135+i] = sr2[i];
			break;
		case  3: for(i = 0; i <  77; i++)	 ffu.s[189+i] = sr3[i];
			break;
		case  4: for(i = 0; i <  89; i++)	 ffu.s[512+i] = sr4[i];
			break;
		case  5: for(i = 0; i <  74; i++)	 ffu.s[741+i] = sr5[i];
			break;
		case  6: for(i = 0; i <  78; i++)	 ffu.s[742+i] = sr6[i];
			break;
		case  7: for(i = 0; i <  78; i++)	 ffu.s[780+i] = sr7[i];
			break;
		case  8: for(i = 0; i <  92; i++)	 ffu.s[799+i] = sr8[i];
			break;
		case  9: for(i = 0; i <  98; i++)	 ffu.s[818+i] = sr9[i];
    }
}

/* Following filter function created using create_iwave.py */

void IWave::avnir(int iwa)
{
    /* "band 1" of AVNIR */
    static const float sr1[52] = {
        .0008, .0017, .0049, .0080, .0186, .0293, .0776, .1260,
        .2609, .3958, .5315, .6672, .6947, .7223, .7262, .7300,
        .7272, .7245, .7717, .8189, .8502, .8815, .9068, .9322,
        .9496, .9669, .9708, .9747, .9873, 1.0000, .9849, .9699,
        .9507, .9316, .9365, .9415, .9632, .9849, .9600, .9351,
        .7552, .5754, .3911, .2068, .1361, .0655, .0440, .0226,
        .0150, .0075, .0046, .0018
    };
	
    /* "band 2" of AVNIR */
    static const float sr2[52] = {
        .0008, .0015, .0030, .0045, .0123, .0202, .0470, .0739,
        .1358, .1977, .3205, .4433, .5633, .6832, .7137, .7442,
        .7594, .7746, .8089, .8432, .8576, .8719, .8721, .8724,
        .8873, .9022, .9254, .9486, .9625, .9764, .9882, 1.0000,
        .9904, .9808, .9349, .8890, .8367, .7843, .7651, .7458,
        .7156, .6854, .5639, .4425, .3005, .1586, .0985, .0384,
        .0236, .0088, .0053, .0017
    };
	
    /* "band 3" of AVNIR */
    static const float sr3[72] = {
        .0008, .0016, .0025, .0034, .0043, .0051, .0075, .0099,
        .0126, .0153, .0228, .0304, .0462, .0620, .0995, .1370,
        .2107, .2844, .3857, .4871, .5747, .6624, .7198, .7771,
        .7896, .8021, .7991, .7960, .7989, .8017, .8312, .8606,
        .8982, .9359, .9592, .9825, .9912, 1.0000, .9931, .9862,
        .9568, .9275, .9046, .8818, .8607, .8395, .8344, .8293,
        .8215, .8136, .7470, .6804, .5481, .4158, .3100, .2043,
        .1471, .0898, .0634, .0369, .0273, .0177, .0135, .0093,
        .0076, .0060, .0045, .0030, .0023, .0015, .0016, .0016

    };
	
    /* "band 4" of AVNIR */
    static const float sr4[102] = {
        .0011, .0023, .0023, .0022, .0033, .0045, .0080, .0115,
        .0190, .0264, .0484, .0704, .1138, .1572, .2351, .3129,
        .4431, .5733, .7244, .8754, .9377, 1.0000, .9884, .9768,
        .9528, .9288, .9091, .8894, .8763, .8633, .8627, .8622,
        .8753, .8885, .9136, .9388, .9437, .9486, .9531, .9576,
        .9411, .9247, .8969, .8691, .8467, .8242, .7893, .7545,
        .7331, .7117, .6911, .6705, .6560, .6414, .6357, .6299,
        .6258, .6217, .6227, .6237, .6025, .5812, .5843, .5874,
        .5867, .5860, .5696, .5532, .5251, .4969, .4438, .3908,
        .3191, .2475, .1906, .1338, .1033, .0727, .0543, .0359,
        .0292, .0224, .0161, .0097, .0069, .0040, .0038, .0036,
        .0030, .0025, .0024, .0024, .0015, .0007, .0004, .0000,
        .0003, .0007, .0006, .0006, .0006, .0006
    };
	
    static const float wli[4] = {0.3975, 0.4925, 0.5625, 0.7175};
    static const float wls[4] = {0.5275, 0.6225, 0.7425, 0.9725};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 52; i++)  ffu.s[59+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 52; i++)  ffu.s[97+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 72; i++)  ffu.s[125+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 102; i++)  ffu.s[187+i] = sr4[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::ikonos(int iwa)
{

    /* Ikonos Green of ikonos */
    static const float sr1[274] = {
        .0008, .0011, .0015, .0012, .0009, .0008, .0007, .0007,
        .0007, .0010, .0013, .0015, .0017, .0018, .0019, .0024,
        .0028, .0040, .0052, .0064, .0077, .0082, .0088, .0103,
        .0119, .0147, .0175, .0262, .0350, .0602, .0854, .1392,
        .1929, .2617, .3305, .3750, .4195, .4638, .5082, .5607,
        .6132, .6437, .6742, .6973, .7204, .7406, .7608, .7605,
        .7601, .7742, .7883, .8225, .8566, .8730, .8894, .9165,
        .9436, .9718, 1.0000, .9934, .9868, .9562, .9255, .8434,
        .7613, .6519, .5424, .4282, .3139, .2590, .2041, .1780,
        .1519, .1188, .0856, .0644, .0432, .0371, .0310, .0288,
        .0266, .0244, .0222, .0221, .0221, .0242, .0262, .0279,
        .0296, .0283, .0270, .0248, .0226, .0240, .0254, .0280,
        .0305, .0289, .0274, .0243, .0213, .0215, .0217, .0257,
        .0296, .0319, .0342, .0306, .0271, .0233, .0195, .0195,
        .0195, .0193, .0190, .0165, .0140, .0107, .0073, .0067,
        .0060, .0056, .0051, .0065, .0079, .0101, .0123, .0161,
        .0200, .0210, .0221, .0214, .0208, .0199, .0190, .0172,
        .0155, .0126, .0097, .0083, .0068, .0059, .0049, .0052,
        .0054, .0085, .0115, .0169, .0222, .0231, .0240, .0180,
        .0121, .0080, .0040, .0031, .0022, .0024, .0026, .0024,
        .0023, .0029, .0035, .0030, .0025, .0024, .0023, .0032,
        .0040, .0038, .0036, .0032, .0027, .0025, .0024, .0025,
        .0026, .0024, .0022, .0019, .0016, .0016, .0016, .0018,
        .0020, .0020, .0020, .0023, .0025, .0031, .0036, .0046,
        .0056, .0061, .0066, .0071, .0075, .0078, .0080, .0087,
        .0095, .0089, .0083, .0085, .0088, .0090, .0093, .0100,
        .0107, .0116, .0125, .0128, .0131, .0131, .0131, .0125,
        .0119, .0112, .0105, .0100, .0095, .0091, .0088, .0086,
        .0084, .0083, .0082, .0081, .0080, .0082, .0084, .0082,
        .0081, .0081, .0080, .0080, .0080, .0074, .0069, .0062,
        .0054, .0051, .0048, .0046, .0045, .0043, .0041, .0038,
        .0036, .0035, .0035, .0034, .0033, .0030, .0028, .0028,
        .0028, .0026, .0024, .0024, .0023, .0025, .0026, .0026,
        .0026, .0026, .0026, .0021, .0016, .0018, .0019, .0022,
        .0024, .0019
    };
	
    /* Ikonos Red of ikonos */
    static const float sr2[274] = {
        .0006, .0007, .0008, .0008, .0007, .0008, .0008, .0007,
        .0006, .0007, .0008, .0007, .0006, .0008, .0009, .0007,
        .0006, .0010, .0013, .0013, .0012, .0019, .0027, .0018,
        .0010, .0011, .0013, .0016, .0019, .0023, .0027, .0030,
        .0034, .0037, .0040, .0049, .0057, .0074, .0091, .0102,
        .0113, .0113, .0113, .0122, .0130, .0151, .0172, .0208,
        .0245, .0306, .0367, .0435, .0503, .0565, .0628, .0861,
        .1094, .1512, .1931, .2421, .2911, .3653, .4396, .5451,
        .6507, .7286, .8066, .8391, .8717, .8801, .8884, .8891,
        .8898, .8824, .8749, .8635, .8521, .8722, .8923, .9450,
        .9977, .9819, .9661, .9369, .9077, .9005, .8932, .9195,
        .9459, .9715, .9972, .9785, .9598, .9186, .8774, .8136,
        .7497, .6259, .5020, .3926, .2832, .2215, .1599, .1334,
        .1068, .0947, .0825, .0732, .0640, .0557, .0474, .0397,
        .0320, .0273, .0227, .0196, .0166, .0155, .0145, .0147,
        .0148, .0155, .0162, .0174, .0186, .0193, .0199, .0193,
        .0188, .0170, .0152, .0138, .0125, .0122, .0119, .0114,
        .0109, .0122, .0135, .0150, .0165, .0174, .0183, .0171,
        .0159, .0135, .0112, .0088, .0063, .0059, .0055, .0044,
        .0034, .0036, .0039, .0037, .0035, .0032, .0030, .0030,
        .0031, .0027, .0023, .0029, .0034, .0035, .0036, .0044,
        .0053, .0059, .0065, .0068, .0072, .0080, .0089, .0092,
        .0095, .0088, .0080, .0075, .0070, .0067, .0064, .0063,
        .0061, .0059, .0056, .0054, .0053, .0057, .0061, .0068,
        .0074, .0070, .0067, .0067, .0067, .0081, .0094, .0111,
        .0128, .0135, .0143, .0151, .0159, .0165, .0171, .0172,
        .0172, .0168, .0163, .0158, .0152, .0143, .0134, .0127,
        .0120, .0113, .0106, .0103, .0100, .0096, .0092, .0095,
        .0098, .0093, .0089, .0087, .0084, .0081, .0078, .0077,
        .0075, .0072, .0070, .0064, .0059, .0056, .0054, .0050,
        .0046, .0043, .0039, .0038, .0036, .0034, .0033, .0031,
        .0029, .0029, .0028, .0028, .0028, .0025, .0022, .0024,
        .0025, .0024, .0022, .0024, .0025, .0023, .0021, .0019,
        .0017, .0019, .0021, .0021, .0020, .0021, .0022, .0018,
        .0014, .0015
    };
	
    /* Ikonos NIR of ikonos */
    static const float sr3[272] = {
        .0003, .0005, .0004, .0004, .0005, .0006, .0005, .0003,
        .0006, .0008, .0007, .0007, .0005, .0004, .0009, .0015,
        .0018, .0020, .0025, .0030, .0033, .0035, .0038, .0040,
        .0041, .0041, .0060, .0078, .0081, .0084, .0083, .0082,
        .0066, .0051, .0038, .0026, .0035, .0043, .0049, .0055,
        .0055, .0055, .0042, .0029, .0023, .0017, .0016, .0015,
        .0026, .0036, .0040, .0043, .0034, .0025, .0023, .0020,
        .0017, .0013, .0014, .0015, .0015, .0015, .0018, .0021,
        .0022, .0024, .0025, .0027, .0030, .0034, .0031, .0029,
        .0029, .0029, .0035, .0041, .0050, .0060, .0066, .0072,
        .0083, .0093, .0093, .0093, .0090, .0087, .0091, .0095,
        .0099, .0103, .0118, .0133, .0169, .0204, .0244, .0285,
        .0316, .0347, .0388, .0428, .0502, .0575, .0715, .0855,
        .1052, .1249, .1506, .1764, .2174, .2584, .3386, .4188,
        .5285, .6381, .7213, .8045, .8414, .8784, .8990, .9196,
        .9364, .9532, .9545, .9559, .9424, .9289, .9339, .9389,
        .9628, .9866, .9917, .9968, .9524, .9079, .8388, .7698,
        .6808, .5919, .5067, .4215, .3634, .3053, .2658, .2262,
        .1923, .1583, .1315, .1046, .0860, .0674, .0560, .0447,
        .0373, .0299, .0269, .0239, .0230, .0220, .0202, .0184,
        .0171, .0159, .0161, .0162, .0159, .0157, .0161, .0165,
        .0168, .0171, .0167, .0163, .0142, .0121, .0106, .0091,
        .0079, .0068, .0065, .0062, .0059, .0056, .0049, .0042,
        .0042, .0042, .0046, .0050, .0045, .0040, .0040, .0040,
        .0033, .0027, .0028, .0030, .0028, .0025, .0029, .0033,
        .0029, .0026, .0026, .0026, .0027, .0028, .0027, .0027,
        .0028, .0028, .0027, .0026, .0026, .0026, .0025, .0025,
        .0024, .0024, .0024, .0023, .0026, .0029, .0028, .0027,
        .0029, .0031, .0035, .0039, .0040, .0040, .0040, .0040,
        .0037, .0035, .0031, .0026, .0024, .0022, .0019, .0016,
        .0015, .0014, .0014, .0013, .0013, .0014, .0012, .0011,
        .0011, .0012, .0012, .0012, .0011, .0010, .0013, .0016,
        .0013, .0010, .0012, .0013, .0014, .0014, .0022, .0029,
        .0023, .0018, .0020, .0023, .0018, .0013, .0011, .0009

    };
	
    static const float wli[3] = {0.3500, 0.3500, 0.3525};
    static const float wls[3] = {1.0350, 1.0350, 1.0325};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 274; i++)  ffu.s[40+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 274; i++)  ffu.s[40+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 272; i++)  ffu.s[41+i] = sr3[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::rapideye(int iwa)
{

    /* "Blue" of rapideye */
    static const float sr1[129] = {
        .0020, .0000, .0000, .0015, .0000, .0000, .0010, .0095,
        .3210, .7250, .7400, .7590, .7700, .7810, .7840, .7935,
        .7960, .8005, .8060, .8040, .8070, .8170, .8200, .8275,
        .8400, .8470, .8620, .8765, .8860, .9105, .9280, .9415,
        .9690, .9685, 1.0000, .9875, .4370, .0190, .0010, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0005,
        .0000
    };
	
    /* "Green" of rapideye */
    static const float sr2[184] = {
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0035, .0020, .0030, .0080, .0000, .0000, .0000,
        .0000, .0000, .0000, .0005, .0020, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0010, .0030, .0130, .0875,
        .5390, .8690, .8680, .8765, .8710, .8755, .8820, .8815,
        .8810, .8885, .8970, .8985, .9010, .9125, .9240, .9290,
        .9360, .9475, .9530, .9625, .9740, .9755, .9760, .9910,
        .9880, .9880, .9940, .9845, .4170, .0265, .0020, .0005,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0010, .0010, .0010, .0005, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0010, .0000

    };
	
    /* "Red" of rapideye */
    static const float sr3[96] = {
        .0000, .0010, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0010, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0005, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0005, .0000, .0000, .0000, .0000, .0020, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0010, .0025, .0090, .0620, .4370, .8595, .8540,
        .8785, .8810, .8875, .9020, .9105, .9150, .9255, .9390,
        .9490, .9580, .9645, .9700, .9785, .9890, .9900, .9850,
        .9970, .9890, .9940, .4630, .0430, .0050, .0010, .0000

    };
	
    /* "RedEdge " of rapideye */
    static const float sr4[100] = {
        .0000, .0270, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0005, .0000, .0005, .0010,
        .0000, .0000, .0000, .0000, .0005, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0220, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0005, .0000,
        .0000, .0000, .0000, .0010, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0010, .0020, .0055, .0210, .1085, .4910, .9490, .9980,
        .9995, .9980, .9915, .9870, .9855, .9820, .9740, .9660,
        .9640, .9610, .9455, .9390, .8980, .4250, .0940, .0200,
        .0055, .0020, .0010, .0000
    };
	
    /* "NIR " of rapideye */
    static const float sr5[162] = {
        .0000, .0010, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0010,
        .0000, .0000, .0000, .0000, .0000, .0110, .0000, .0000,
        .0000, .0000, .0000, .0000, .0010, .0000, .0000, .0000,
        .0010, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0005, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0010, .0010,
        .0000, .0000, .0000, .0000, .0000, .0000, .0005, .0030,
        .0010, .0000, .0000, .0000, .0000, .0000, .0010, .0020,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0015, .0030, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0005, .0010, .0015, .0030,
        .0055, .0120, .0275, .0680, .1920, .4970, .8825, 1.0000,
        .9775, .9670, .9760, .9830, .9795, .9700, .9620, .9580,
        .9575, .9580, .9585, .9560, .9535, .9480, .9425, .9370,
        .9320, .9280, .9270, .9260, .9255, .9230, .9165, .9060,
        .8965, .8890, .8845, .8820, .8735, .8570, .8400, .8400,
        .8135, .5820, .2440, .0800, .0285, .0110, .0050, .0020,
        .0010, .0010
    };
	
    static const float wli[5] = {0.4200, 0.4200, 0.4575, 0.4975, 0.4675};
    static const float wls[5] = {0.7425, 0.8800, 0.6975, 0.7475, 0.8725};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 129; i++)  ffu.s[68+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 184; i++)  ffu.s[68+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 96; i++)  ffu.s[83+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 100; i++)  ffu.s[99+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 162; i++)  ffu.s[87+i] = sr5[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::vgt1_spot4(int iwa)
{

    /* B0 of VGT1_spot4 */
    static const float sr1[40] = {
        .0001, .0003, .0005, .0007, .0010, .0013, .0028, .0050,
        .0182, .0377, .0828, .1423, .2234, .3168, .4108, .5052,
        .5925, .6759, .7509, .8212, .8815, .9361, .9699, .9920,
        .9907, .9761, .9528, .9248, .8811, .8287, .7223, .5857,
        .4394, .2876, .1820, .1024, .0579, .0331, .0196, .0125

    };
	
    /* B2 of VGT1_spot4 */
    static const float sr2[82] = {
        .0000, .0017, .0017, .0016, .0016, .0016, .0024, .0031,
        .0039, .0046, .0439, .0832, .1225, .1618, .2737, .3856,
        .4975, .6094, .6615, .7136, .7657, .8178, .8278, .8377,
        .8477, .8577, .8673, .8769, .8865, .8961, .9088, .9214,
        .9341, .9468, .9595, .9722, .9849, .9976, .9895, .9815,
        .9734, .9653, .9169, .8685, .8201, .7717, .6989, .6260,
        .5532, .4804, .4243, .3681, .3120, .2559, .2229, .1899,
        .1569, .1239, .1063, .0887, .0712, .0536, .0454, .0372,
        .0289, .0207, .0175, .0143, .0111, .0079, .0069, .0060,
        .0050, .0040, .0034, .0027, .0021, .0015, .0015, .0015,
        .0015, .0015
    };
	
    /* B3 of VGT1_spot4 */
    static const float sr3[134] = {
        .0000, .0007, .0008, .0008, .0009, .0010, .0011, .0013,
        .0014, .0015, .0019, .0022, .0026, .0030, .0051, .0072,
        .0092, .0113, .0210, .0308, .0406, .0503, .0806, .1109,
        .1411, .1714, .2271, .2828, .3385, .3942, .4584, .5226,
        .5869, .6511, .6966, .7421, .7876, .8331, .8607, .8883,
        .9159, .9435, .9552, .9668, .9785, .9902, .9927, .9951,
        .9976, 1.0000, .9999, .9997, .9996, .9994, .9984, .9974,
        .9964, .9954, .9927, .9900, .9873, .9846, .9766, .9686,
        .9606, .9526, .9445, .9365, .9284, .9203, .9008, .8813,
        .8618, .8423, .7897, .7370, .6844, .6318, .5584, .4849,
        .4114, .3380, .2893, .2407, .1920, .1434, .1222, .1010,
        .0798, .0586, .0505, .0425, .0345, .0264, .0229, .0194,
        .0159, .0124, .0111, .0098, .0085, .0072, .0065, .0057,
        .0050, .0042, .0038, .0034, .0031, .0027, .0024, .0021,
        .0017, .0014, .0014, .0014, .0013, .0013, .0013, .0013,
        .0012, .0012, .0012, .0011, .0011, .0011, .0010, .0009,
        .0009, .0008, .0007, .0006, .0006, .0005
    };
	
    /* MIR of VGT1_spot4 */
    static const float sr4[141] = {
        .0000, .0010, .0010, .0010, .0010, .0010, .0011, .0011,
        .0012, .0013, .0014, .0014, .0015, .0016, .0016, .0017,
        .0018, .0018, .0019, .0021, .0022, .0024, .0026, .0028,
        .0030, .0032, .0035, .0038, .0041, .0044, .0050, .0055,
        .0060, .0066, .0075, .0083, .0092, .0101, .0118, .0136,
        .0154, .0171, .0203, .0235, .0267, .0299, .0366, .0433,
        .0501, .0568, .0708, .0848, .0989, .1129, .1406, .1684,
        .1961, .2239, .2691, .3142, .3594, .4045, .4677, .5308,
        .5939, .6571, .7099, .7628, .8156, .8685, .8934, .9183,
        .9433, .9682, .9761, .9841, .9920, 1.0000, .9971, .9941,
        .9912, .9883, .9840, .9797, .9753, .9710, .9517, .9325,
        .9132, .8939, .8713, .8488, .8262, .8036, .7457, .6878,
        .6299, .5720, .5109, .4498, .3887, .3276, .2926, .2576,
        .2226, .1876, .1704, .1531, .1358, .1186, .1078, .0970,
        .0863, .0755, .0685, .0614, .0544, .0474, .0430, .0385,
        .0340, .0296, .0269, .0242, .0214, .0187, .0172, .0157,
        .0142, .0127, .0118, .0109, .0101, .0092, .0086, .0080,
        .0075, .0069, .0064, .0060, .0055
    };
	
    static const float wli[4] = {0.4000, 0.5775, 0.6975, 1.4475};
    static const float wls[4] = {0.5000, 0.7825, 1.0325, 1.8000};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 40; i++)  ffu.s[60+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 82; i++)  ffu.s[131+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 134; i++)  ffu.s[179+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 141; i++)  ffu.s[479+i] = sr4[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::vgt2_spot5(int iwa)
{

    /* B0 of VGT2_spot5 */
    static const float sr1[61] = {
        .0007, .0008, .0010, .0010, .0011, .0012, .0013, .0029,
        .0045, .0209, .0374, .0964, .1553, .2551, .3549, .4536,
        .5524, .6318, .7111, .7602, .8093, .8304, .8514, .8698,
        .8882, .9441, 1.0000, .9787, .9574, .7493, .5412, .3553,
        .1694, .1083, .0472, .0318, .0163, .0116, .0069, .0053,
        .0036, .0028, .0020, .0017, .0014, .0011, .0009, .0008,
        .0008, .0008, .0007, .0006, .0006, .0006, .0005, .0004,
        .0004, .0004, .0004, .0003, .0003
    };
	
    /* B2 of VGT2_spot5 */
    static const float sr2[82] = {
        .0000, .0006, .0006, .0006, .0007, .0007, .0033, .0059,
        .0084, .0110, .0688, .1265, .1842, .2420, .3532, .4643,
        .5755, .6866, .7306, .7745, .8185, .8625, .8766, .8906,
        .9046, .9187, .9307, .9426, .9546, .9666, .9749, .9833,
        .9917, 1.0000, .9957, .9915, .9872, .9829, .9387, .8945,
        .8503, .8061, .7316, .6570, .5825, .5079, .4468, .3856,
        .3245, .2634, .2293, .1952, .1611, .1270, .1095, .0921,
        .0746, .0572, .0490, .0408, .0326, .0244, .0208, .0171,
        .0135, .0099, .0085, .0071, .0057, .0043, .0037, .0031,
        .0025, .0019, .0017, .0014, .0012, .0010, .0009, .0008,
        .0007, .0006
    };
	
    /* B3 of VGT2_spot5 */
    static const float sr3[122] = {
        .0000, .0003, .0003, .0003, .0003, .0003, .0003, .0003,
        .0004, .0004, .0005, .0006, .0008, .0009, .0017, .0024,
        .0032, .0040, .0082, .0124, .0166, .0208, .0361, .0514,
        .0667, .0820, .1175, .1530, .1885, .2240, .2774, .3309,
        .3844, .4378, .4906, .5434, .5962, .6490, .6899, .7308,
        .7716, .8125, .8369, .8612, .8856, .9100, .9248, .9396,
        .9544, .9692, .9761, .9829, .9898, .9967, .9975, .9983,
        .9992, 1.0000, .9939, .9878, .9817, .9756, .9618, .9480,
        .9342, .9204, .9030, .8856, .8682, .8508, .8236, .7965,
        .7693, .7422, .6945, .6467, .5989, .5512, .4910, .4308,
        .3706, .3104, .2681, .2258, .1836, .1413, .1213, .1013,
        .0813, .0613, .0530, .0447, .0364, .0281, .0245, .0209,
        .0172, .0136, .0120, .0104, .0089, .0073, .0065, .0056,
        .0047, .0039, .0036, .0032, .0029, .0025, .0023, .0021,
        .0018, .0016, .0015, .0014, .0012, .0011, .0010, .0008,
        .0007, .0006
    };
	
    /* MIR of VGT2_spot5 */
    static const float sr4[141] = {
        .0000, .0005, .0006, .0006, .0007, .0008, .0008, .0008,
        .0009, .0009, .0009, .0009, .0009, .0009, .0011, .0014,
        .0016, .0019, .0022, .0024, .0027, .0029, .0034, .0040,
        .0045, .0050, .0060, .0070, .0080, .0090, .0108, .0126,
        .0143, .0161, .0196, .0231, .0266, .0301, .0372, .0444,
        .0515, .0586, .0723, .0860, .0997, .1134, .1401, .1668,
        .1936, .2203, .2668, .3134, .3599, .4065, .4664, .5263,
        .5863, .6462, .6929, .7396, .7862, .8329, .8630, .8931,
        .9233, .9534, .9644, .9754, .9863, .9973, .9980, .9987,
        .9993, 1.0000, .9987, .9974, .9962, .9949, .9914, .9879,
        .9845, .9810, .9687, .9564, .9440, .9317, .9055, .8793,
        .8532, .8270, .7811, .7351, .6892, .6433, .5746, .5059,
        .4371, .3684, .3244, .2803, .2363, .1923, .1713, .1502,
        .1292, .1082, .0970, .0859, .0747, .0636, .0575, .0514,
        .0453, .0392, .0360, .0327, .0295, .0262, .0235, .0209,
        .0182, .0155, .0139, .0123, .0106, .0090, .0082, .0073,
        .0065, .0057, .0053, .0050, .0046, .0043, .0040, .0037,
        .0033, .0030, .0026, .0022, .0019
    };
	
    static const float wli[4] = {0.4000, 0.5775, 0.6975, 1.4475};
    static const float wls[4] = {0.5525, 0.7825, 1.0025, 1.8000};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 61; i++)  ffu.s[60+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 82; i++)  ffu.s[131+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 122; i++)  ffu.s[179+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 141; i++)  ffu.s[479+i] = sr4[i];
        break;
    }
}


void IWave::worldview2(int iwa)
{

    /* Panchromatic of worldview2 */
    static const float sr1[225] = {
        .0000, .0001, .0003, .0005, .0017, .0030, .0559, .1098,
        .2713, .4362, .4618, .4875, .4949, .5050, .5152, .5256,
        .5296, .5356, .5298, .5222, .5272, .5337, .5286, .5231,
        .5411, .5573, .5582, .5582, .5809, .6055, .6162, .6268,
        .6121, .5954, .6120, .6307, .6492, .6715, .6637, .6547,
        .6725, .6931, .6913, .6882, .6783, .6650, .6833, .7016,
        .7060, .7136, .7098, .7098, .7384, .7658, .7628, .7578,
        .7592, .7598, .7800, .7941, .7979, .8007, .8114, .8193,
        .8208, .8230, .8298, .8389, .8489, .8608, .8580, .8585,
        .8652, .8703, .8779, .8893, .8965, .9093, .9131, .9179,
        .9142, .9108, .9170, .9249, .9368, .9508, .9440, .9369,
        .9323, .9294, .9383, .9512, .9600, .9628, .9575, .9539,
        .9548, .9574, .9682, .9777, .9613, .9492, .9470, .9533,
        .9467, .9522, .9625, .9696, .9840, 1.0000, .9943, .9940,
        .9810, .9696, .9683, .9684, .9737, .9789, .9668, .9637,
        .9523, .9467, .9459, .9529, .9548, .9626, .9621, .9566,
        .9504, .9410, .9362, .9246, .9234, .9217, .9336, .9408,
        .9580, .9638, .9581, .9413, .9243, .9030, .8959, .8872,
        .9105, .9294, .7440, .5539, .3202, .0858, .0514, .0173,
        .0120, .0066, .0044, .0021, .0015, .0009, .0007, .0005,
        .0005, .0004, .0004, .0004, .0004, .0004, .0004, .0004,
        .0004, .0004, .0003, .0003, .0003, .0003, .0003, .0003,
        .0003, .0002, .0003, .0003, .0003, .0003, .0003, .0002,
        .0002, .0003, .0003, .0003, .0003, .0002, .0002, .0003,
        .0003, .0003, .0003, .0003, .0003, .0003, .0003, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001
    };
	
    /* Coastal Blue of worldview2 */
    static const float sr2[174] = {
        .0000, .0000, .0002, .0006, .0034, .0274, .1329, .3560,
        .5926, .7007, .7396, .7653, .7878, .8171, .8387, .8618,
        .8835, .9051, .9171, .9272, .9477, .9651, .9793, .9859,
        .9891, .9972, .9746, .8539, .5880, .2816, .0805, .0089,
        .0013, .0004, .0001, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0001,
        .0001, .0000, .0000, .0000, .0000, .0001, .0002, .0004,
        .0003, .0001, .0000, .0001, .0003, .0007, .0004, .0001,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0001, .0001, .0002, .0002, .0001, .0001, .0001,
        .0001, .0002, .0002, .0002, .0001, .0001
    };
	
    /* Blue of worldview2 */
    static const float sr3[158] = {
        .0001, .0001, .0001, .0003, .0010, .0023, .0054, .0198,
        .0818, .2452, .5033, .7010, .7576, .7783, .7886, .8000,
        .8017, .8099, .8211, .8260, .8309, .8423, .8627, .8785,
        .8769, .8783, .8876, .9076, .9306, .9502, .9768, 1.0000,
        .9789, .8558, .5939, .2976, .1257, .0504, .0182, .0057,
        .0030, .0017, .0010, .0006, .0004, .0003, .0002, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0001, .0001, .0001, .0000, .0000, .0001, .0001, .0001,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0001, .0001, .0000, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001
    };
	
    /* Green of worldview2 */
    static const float sr4[245] = {
        .0000, .0001, .0001, .0004, .0011, .0031, .0111, .0405,
        .1338, .3515, .6060, .7230, .7600, .7794, .7888, .8068,
        .8280, .8408, .8420, .8443, .8469, .8503, .8597, .8635,
        .8691, .8826, .9007, .9245, .9422, .9623, .9766, .9857,
        .9948, 1.0000, .9931, .9791, .9077, .6640, .3014, .0929,
        .0252, .0056, .0025, .0011, .0005, .0002, .0001, .0001,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0001, .0001, .0001, .0001
    };
	
    /* Yellow of worldview2 */
    static const float sr5[33] = {
        .0001, .0001, .0003, .0009, .0022, .0059, .0266, .1347,
        .3892, .6636, .8482, .8998, .9200, .9326, .9402, .9470,
        .9524, .9664, .9815, .9897, .9927, 1.0000, .9694, .7594,
        .4367, .1343, .0309, .0074, .0022, .0007, .0003, .0002,
        .0001
    };
	
    /* Red of worldview2 */
    static const float sr6[43] = {
        .0000, .0001, .0001, .0003, .0006, .0016, .0049, .0228,
        .0956, .2944, .5961, .8223, .8728, .8853, .9279, .9557,
        .9650, .9671, .9656, .9578, .9555, .9528, .9558, .9653,
        .9704, .9765, .9875, .9966, .9991, .9921, .9837, .9783,
        .8853, .6326, .2918, .0833, .0204, .0056, .0019, .0008,
        .0004, .0002, .0001
    };
	
    /* Red Edge of worldview2 */
    static const float sr7[60] = {
        .0001, .0001, .0002, .0002, .0001, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0001, .0002, .0008, .0031,
        .0188, .0996, .3468, .6229, .8538, .9528, .9784, .9876,
        .9890, .9939, .9999, .9993, .9894, .9868, .9810, .9771,
        .9442, .8464, .6158, .3598, .1388, .0305, .0071, .0022,
        .0007, .0003, .0001, .0001
    };
	
    /* NIR1 of worldview2 */
    static const float sr8[86] = {
        .0001, .0001, .0002, .0003, .0004, .0007, .0014, .0029,
        .0060, .0127, .0277, .0589, .1231, .2602, .5068, .7600,
        .9406, .9958, .9976, .9889, .9831, .9729, .9583, .9411,
        .9319, .9194, .9091, .8976, .8821, .8712, .8631, .8443,
        .8365, .8380, .8412, .8357, .8338, .8425, .8308, .8186,
        .8168, .8067, .8108, .7942, .7799, .7673, .7496, .7393,
        .7387, .7341, .7118, .6971, .6805, .6586, .6498, .6325,
        .6199, .6091, .5990, .5909, .5661, .5071, .4028, .2752,
        .1577, .0738, .0328, .0138, .0054, .0026, .0018, .0013,
        .0010, .0009, .0009, .0008, .0007, .0007, .0008, .0007,
        .0007, .0006, .0006, .0003, .0003, .0000
    };
	
    /* NIR2 of worldview2 */
    static const float sr9[288] = {
        .0000, .0001, .0001, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0001,
        .0005, .0005, .0008, .0010, .0010, .0011, .0011, .0011,
        .0011, .0011, .0011, .0011, .0010, .0011, .0011, .0012,
        .0012, .0012, .0014, .0013, .0015, .0022, .0043, .0106,
        .0306, .1079, .3137, .5719, .7893, .9515, .9871, .9917,
        .9934, .9997, .9967, .9833, .9709, .9524, .9330, .9224,
        .9109, .8998, .8921, .8786, .8646, .8505, .8413, .8273,
        .8082, .7940, .7744, .7603, .7469, .7258, .7090, .6892,
        .6617, .6406, .6209, .5965, .5747, .5519, .5309, .5116,
        .4937, .4741, .4543, .4378, .4214, .4060, .3897, .3766,
        .3635, .3499, .3367, .3270, .3171, .3058, .2949, .2822,
        .2714, .2608, .2509, .2434, .2357, .2277, .2176, .2087,
        .1986, .1882, .1787, .1684, .1590, .1481, .1378, .1246,
        .1096, .0917, .0715, .0503, .0328, .0199, .0098, .0047,
        .0022, .0010, .0005, .0003, .0002, .0001, .0001, .0001

    };
	
    static const float wli[9] = {0.4325, 0.3825, 0.4225, 0.4875, 0.5675, 0.6050, 0.6175, 0.7375, 0.3550};
    static const float wls[9] = {0.9950, 0.8175, 0.8175, 1.1000, 0.6500, 0.7125, 0.7675, 0.9525, 1.0750};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 225; i++)  ffu.s[73+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 174; i++)  ffu.s[53+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 158; i++)  ffu.s[69+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 245; i++)  ffu.s[95+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 33; i++)  ffu.s[127+i] = sr5[i];
        break;
    case 6: for(i = 0; i < 43; i++)  ffu.s[142+i] = sr6[i];
        break;
    case 7: for(i = 0; i < 60; i++)  ffu.s[147+i] = sr7[i];
        break;
    case 8: for(i = 0; i < 86; i++)  ffu.s[195+i] = sr8[i];
        break;
    case 9: for(i = 0; i < 288; i++)  ffu.s[42+i] = sr9[i];
        break;
    }
}

void IWave::quickbird2(int iwa)
{

    /* pan of quickbird2 */
    static const float sr1[286] = {
        .0007, .0014, .0013, .0012, .0011, .0011, .0010, .0009,
        .0010, .0012, .0016, .0020, .0044, .0069, .0089, .0109,
        .0138, .0167, .0213, .0259, .0311, .0362, .0434, .0506,
        .0588, .0669, .0758, .0846, .0939, .1032, .1125, .1219,
        .1334, .1450, .1567, .1684, .1789, .1895, .2011, .2127,
        .2163, .2198, .2392, .2586, .2669, .2753, .2854, .2955,
        .3055, .3154, .3259, .3364, .3410, .3456, .3501, .3546,
        .3579, .3611, .3648, .3685, .3733, .3781, .3875, .3969,
        .4055, .4141, .4276, .4410, .4543, .4676, .4829, .4982,
        .5167, .5352, .5532, .5712, .5925, .6137, .6382, .6627,
        .6839, .7051, .7275, .7499, .7705, .7910, .8105, .8301,
        .8465, .8629, .8770, .8911, .9081, .9251, .9293, .9335,
        .9426, .9518, .9570, .9621, .9610, .9598, .9753, .9907,
        .9941, .9975, .9922, .9869, .9935, 1.0000, .9938, .9876,
        .9877, .9878, .9770, .9662, .9573, .9483, .9340, .9197,
        .9190, .9183, .9063, .8944, .8912, .8880, .8831, .8781,
        .8865, .8949, .8921, .8893, .8858, .8823, .8869, .8916,
        .8848, .8780, .8879, .8978, .8933, .8888, .8801, .8714,
        .8690, .8667, .8677, .8687, .8699, .8712, .8668, .8625,
        .8718, .8810, .8814, .8818, .8897, .8976, .9024, .9072,
        .9183, .9295, .9311, .9326, .9198, .9070, .9130, .9191,
        .9173, .9155, .9097, .9039, .8988, .8936, .8871, .8805,
        .8761, .8717, .8605, .8493, .8475, .8457, .8505, .8553,
        .8568, .8582, .8582, .8583, .8627, .8671, .8505, .8339,
        .8390, .8440, .8470, .8500, .8526, .8553, .8447, .8341,
        .8368, .8394, .8235, .8076, .8091, .8106, .7850, .7594,
        .7616, .7638, .7490, .7342, .7204, .7066, .7003, .6941,
        .6788, .6634, .6589, .6545, .6365, .6186, .6094, .6003,
        .5961, .5919, .5832, .5744, .5527, .5309, .5139, .4969,
        .4883, .4798, .4630, .4463, .4305, .4147, .4097, .4048,
        .3893, .3738, .3593, .3448, .3283, .3118, .3035, .2952,
        .2840, .2729, .2648, .2567, .2498, .2428, .2322, .2216,
        .2162, .2107, .2039, .1971, .1874, .1776, .1703, .1630,
        .1557, .1485, .1421, .1358, .1299, .1240, .1162, .1085,
        .1020, .0954, .0893, .0831, .0773, .0715, .0675, .0634,
        .0591, .0548, .0512, .0476, .0288, .0101
    };
	
    /* blue of quickbird2 */
    static const float sr2[292] = {
        .0005, .0010, .0015, .0021, .0026, .0031, .0037, .0042,
        .0044, .0045, .0049, .0053, .0047, .0041, .0037, .0033,
        .0030, .0027, .0025, .0023, .0018, .0013, .0015, .0018,
        .0020, .0022, .0023, .0024, .0025, .0026, .0025, .0025,
        .0027, .0029, .0035, .0040, .0053, .0066, .0098, .0131,
        .0208, .0284, .0483, .0681, .1116, .1552, .2164, .2776,
        .3544, .4313, .5306, .6299, .6770, .7241, .7577, .7914,
        .8176, .8439, .8667, .8896, .9037, .9178, .9235, .9293,
        .9447, .9602, .9801, 1.0000, .9958, .9916, .9548, .9179,
        .8452, .7724, .6729, .5734, .4787, .3840, .3247, .2653,
        .2123, .1592, .1204, .0816, .0754, .0692, .0663, .0633,
        .0551, .0469, .0381, .0293, .0235, .0176, .0152, .0127,
        .0126, .0125, .0127, .0129, .0128, .0126, .0119, .0111,
        .0106, .0101, .0098, .0096, .0094, .0093, .0095, .0098,
        .0102, .0106, .0105, .0104, .0091, .0079, .0066, .0054,
        .0045, .0036, .0031, .0026, .0026, .0025, .0025, .0025,
        .0025, .0025, .0027, .0028, .0027, .0027, .0027, .0027,
        .0030, .0033, .0039, .0044, .0067, .0089, .0125, .0162,
        .0202, .0242, .0256, .0271, .0231, .0191, .0137, .0083,
        .0070, .0056, .0063, .0070, .0086, .0102, .0111, .0121,
        .0106, .0091, .0064, .0037, .0032, .0027, .0028, .0029,
        .0028, .0027, .0029, .0031, .0032, .0032, .0034, .0036,
        .0034, .0033, .0034, .0036, .0036, .0036, .0034, .0031,
        .0032, .0034, .0033, .0032, .0031, .0031, .0031, .0030,
        .0031, .0033, .0033, .0033, .0035, .0036, .0036, .0037,
        .0039, .0040, .0041, .0041, .0042, .0043, .0042, .0042,
        .0046, .0050, .0049, .0048, .0053, .0059, .0058, .0057,
        .0057, .0056, .0055, .0053, .0053, .0052, .0052, .0052,
        .0052, .0052, .0052, .0053, .0055, .0057, .0063, .0068,
        .0075, .0083, .0090, .0098, .0101, .0105, .0107, .0109,
        .0101, .0093, .0085, .0076, .0069, .0061, .0056, .0050,
        .0046, .0042, .0039, .0035, .0032, .0029, .0025, .0021,
        .0019, .0017, .0016, .0016, .0015, .0014, .0013, .0012,
        .0012, .0012, .0012, .0012, .0012, .0011, .0011, .0011,
        .0011, .0010, .0011, .0011, .0012, .0012, .0012, .0012,
        .0013, .0015, .0016, .0018, .0017, .0015, .0015, .0015,
        .0015, .0014, .0013, .0012
    };
	
    /* green of quickbird2 */
    static const float sr3[282] = {
        .0015, .0031, .0036, .0040, .0031, .0022, .0023, .0023,
        .0019, .0015, .0015, .0014, .0011, .0008, .0010, .0011,
        .0012, .0012, .0012, .0012, .0012, .0012, .0012, .0011,
        .0012, .0012, .0013, .0014, .0016, .0019, .0021, .0023,
        .0026, .0028, .0033, .0037, .0046, .0055, .0077, .0098,
        .0138, .0178, .0206, .0234, .0268, .0301, .0356, .0412,
        .0504, .0597, .0789, .0982, .1274, .1566, .1924, .2282,
        .2739, .3196, .3686, .4175, .4726, .5277, .5928, .6579,
        .7138, .7698, .8005, .8312, .8378, .8445, .8575, .8705,
        .8893, .9082, .9271, .9460, .9640, .9819, .9910, 1.0000,
        .9967, .9934, .9876, .9818, .9755, .9691, .9733, .9774,
        .9822, .9869, .9761, .9652, .9316, .8979, .8445, .7910,
        .7230, .6551, .5687, .4822, .3973, .3124, .2579, .2033,
        .1706, .1378, .1139, .0901, .0729, .0557, .0461, .0365,
        .0322, .0278, .0270, .0262, .0268, .0274, .0275, .0275,
        .0259, .0242, .0214, .0186, .0167, .0148, .0140, .0132,
        .0132, .0132, .0132, .0132, .0124, .0116, .0104, .0092,
        .0076, .0061, .0052, .0043, .0038, .0032, .0030, .0029,
        .0029, .0029, .0035, .0040, .0051, .0062, .0069, .0076,
        .0076, .0076, .0067, .0057, .0047, .0037, .0032, .0026,
        .0024, .0022, .0024, .0026, .0028, .0030, .0029, .0028,
        .0030, .0031, .0032, .0034, .0037, .0040, .0039, .0038,
        .0041, .0044, .0043, .0041, .0040, .0038, .0036, .0035,
        .0034, .0032, .0031, .0030, .0030, .0030, .0031, .0031,
        .0032, .0032, .0033, .0033, .0035, .0037, .0041, .0044,
        .0048, .0051, .0060, .0069, .0073, .0078, .0084, .0091,
        .0091, .0092, .0091, .0090, .0088, .0086, .0083, .0080,
        .0078, .0076, .0075, .0075, .0075, .0076, .0077, .0078,
        .0080, .0081, .0081, .0082, .0080, .0078, .0072, .0067,
        .0061, .0056, .0051, .0046, .0043, .0039, .0035, .0031,
        .0029, .0027, .0023, .0020, .0018, .0017, .0016, .0015,
        .0014, .0012, .0012, .0013, .0012, .0011, .0010, .0009,
        .0010, .0010, .0009, .0009, .0008, .0008, .0008, .0009,
        .0009, .0009, .0009, .0010, .0010, .0011, .0012, .0013,
        .0012, .0011, .0011, .0011, .0010, .0009, .0009, .0010,
        .0009, .0009
    };
	
    /* red of quickbird2 */
    static const float sr4[282] = {
        .0019, .0037, .0031, .0024, .0020, .0016, .0018, .0019,
        .0016, .0012, .0011, .0011, .0010, .0009, .0009, .0010,
        .0009, .0009, .0011, .0013, .0010, .0007, .0009, .0012,
        .0012, .0013, .0013, .0013, .0012, .0012, .0011, .0010,
        .0013, .0015, .0018, .0021, .0024, .0028, .0029, .0031,
        .0030, .0029, .0029, .0028, .0029, .0030, .0032, .0035,
        .0036, .0037, .0034, .0032, .0026, .0021, .0021, .0022,
        .0023, .0024, .0025, .0027, .0029, .0031, .0032, .0033,
        .0034, .0035, .0036, .0037, .0041, .0046, .0049, .0053,
        .0056, .0060, .0061, .0063, .0065, .0066, .0068, .0069,
        .0073, .0078, .0084, .0090, .0096, .0102, .0110, .0118,
        .0128, .0139, .0158, .0177, .0207, .0238, .0286, .0334,
        .0399, .0464, .0548, .0631, .0751, .0872, .1077, .1281,
        .1666, .2050, .2675, .3301, .4130, .4960, .5790, .6620,
        .7337, .8054, .8447, .8840, .8976, .9112, .9265, .9418,
        .9608, .9798, .9878, .9958, .9979, 1.0000, .9961, .9923,
        .9723, .9524, .9125, .8726, .8128, .7530, .6767, .6004,
        .5119, .4235, .3520, .2806, .2228, .1651, .1304, .0957,
        .0744, .0531, .0417, .0302, .0261, .0220, .0210, .0201,
        .0204, .0207, .0211, .0215, .0205, .0196, .0172, .0148,
        .0121, .0095, .0081, .0066, .0058, .0050, .0048, .0045,
        .0043, .0042, .0043, .0045, .0048, .0051, .0055, .0060,
        .0063, .0067, .0064, .0062, .0053, .0045, .0038, .0031,
        .0029, .0027, .0026, .0024, .0025, .0025, .0025, .0025,
        .0024, .0024, .0025, .0026, .0025, .0024, .0025, .0026,
        .0026, .0025, .0026, .0026, .0026, .0025, .0024, .0023,
        .0024, .0024, .0023, .0022, .0022, .0021, .0021, .0020,
        .0019, .0019, .0019, .0020, .0021, .0021, .0023, .0025,
        .0026, .0028, .0028, .0028, .0027, .0025, .0020, .0015,
        .0013, .0012, .0011, .0011, .0010, .0010, .0010, .0010,
        .0010, .0010, .0009, .0008, .0008, .0008, .0008, .0007,
        .0007, .0007, .0007, .0007, .0007, .0007, .0006, .0006,
        .0006, .0006, .0007, .0007, .0007, .0008, .0007, .0007,
        .0007, .0006, .0007, .0009, .0009, .0009, .0008, .0008,
        .0008, .0008, .0009, .0009, .0009, .0009, .0008, .0006,
        .0007, .0008
    };
	
    /* nir of quickbird2 */
    static const float sr5[292] = {
        .0007, .0014, .0021, .0029, .0036, .0044, .0051, .0059,
        .0061, .0063, .0062, .0060, .0057, .0054, .0045, .0035,
        .0028, .0021, .0023, .0024, .0021, .0017, .0020, .0023,
        .0021, .0019, .0017, .0016, .0018, .0019, .0019, .0018,
        .0017, .0015, .0015, .0015, .0017, .0019, .0018, .0017,
        .0021, .0024, .0025, .0025, .0028, .0031, .0036, .0040,
        .0044, .0047, .0047, .0047, .0048, .0049, .0045, .0042,
        .0043, .0044, .0046, .0048, .0050, .0052, .0054, .0056,
        .0054, .0052, .0047, .0042, .0036, .0030, .0028, .0026,
        .0026, .0026, .0026, .0025, .0027, .0029, .0027, .0026,
        .0030, .0034, .0043, .0053, .0066, .0079, .0089, .0099,
        .0101, .0102, .0090, .0079, .0064, .0049, .0049, .0048,
        .0056, .0063, .0070, .0077, .0078, .0079, .0072, .0065,
        .0054, .0044, .0041, .0038, .0038, .0037, .0037, .0036,
        .0036, .0036, .0038, .0039, .0042, .0045, .0047, .0049,
        .0053, .0057, .0059, .0061, .0064, .0068, .0070, .0073,
        .0079, .0086, .0093, .0100, .0106, .0112, .0117, .0122,
        .0126, .0129, .0132, .0135, .0140, .0144, .0150, .0156,
        .0164, .0172, .0184, .0196, .0218, .0241, .0268, .0294,
        .0319, .0343, .0375, .0407, .0448, .0490, .0545, .0599,
        .0664, .0729, .0817, .0905, .1050, .1195, .1410, .1625,
        .2024, .2424, .3015, .3606, .4268, .4930, .5640, .6350,
        .7166, .7983, .8726, .9469, .9735, 1.0000, .9986, .9971,
        .9837, .9702, .9526, .9350, .9179, .9009, .8853, .8698,
        .8606, .8515, .8449, .8382, .8352, .8322, .8289, .8256,
        .8230, .8204, .8137, .8070, .7957, .7844, .7669, .7495,
        .7267, .7040, .6911, .6782, .6638, .6494, .6313, .6132,
        .5900, .5669, .5493, .5317, .5117, .4917, .4644, .4371,
        .3943, .3515, .3134, .2753, .2485, .2216, .1910, .1604,
        .1385, .1166, .1003, .0840, .0756, .0672, .0540, .0409,
        .0307, .0205, .0170, .0135, .0118, .0100, .0089, .0078,
        .0071, .0064, .0059, .0054, .0050, .0046, .0040, .0035,
        .0031, .0028, .0026, .0024, .0023, .0022, .0022, .0021,
        .0020, .0019, .0018, .0018, .0019, .0019, .0018, .0016,
        .0017, .0017, .0017, .0017, .0019, .0020, .0021, .0021,
        .0021, .0020, .0020, .0019, .0018, .0017, .0018, .0018,
        .0018, .0017, .0018, .0020
    };
	
    static const float wli[5] = {0.3475, 0.3225, 0.3475, 0.3475, 0.3225};
    static const float wls[5] = {1.0625, 1.0525, 1.0525, 1.0525, 1.0525};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 286; i++)  ffu.s[39+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 292; i++)  ffu.s[29+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 282; i++)  ffu.s[39+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 282; i++)  ffu.s[39+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 292; i++)  ffu.s[29+i] = sr5[i];
        break;
    }
}

void IWave::landsat_8(int iwa)
{

    /* Coastal Aerosol of landsat_8 */
    static const float sr1[14] = {
        .0003, .0034, .0552, .5178, .9335, .9838, .9902, 1.0000,
        .9777, .7456, .1596, .0145, .0017, .0000
    };
	
    /* Blue of landsat_8 */
    static const float sr2[37] = {
        .0000, .0001, .0003, .0010, .0037, .0202, .1309, .6088,
        .8942, .9104, .8980, .8805, .8747, .8892, .8612, .8346,
        .8659, .9014, .9188, .9430, .9624, .9660, .9856, .9755,
        .9768, .9741, .9641, .9743, .9657, .9844, .9556, .3627,
        .0139, .0021, .0008, .0002, .0001
    };
	
    /* Green of landsat_8 */
    static const float sr3[37] = {
        .0000, .0000, .0002, .0008, .0018, .0042, .0104, .0335,
        .1234, .4499, .8652, .9544, .9613, .9612, .9783, .9789,
        1.0000, .9832, .9651, .9471, .9665, .9599, .9700, .9822,
        .9672, .9770, .9800, .9685, .9796, .9763, .9742, .8569,
        .5253, .1391, .0141, .0018, .0001
    };
	
    /* Red of landsat_8 */
    static const float sr4[25] = {
        .0000, .0001, .0014, .0072, .0486, .2998, .8350, .9508,
        .9573, .9842, .9832, .9594, .9544, .9817, .9885, .9770,
        .9889, .9807, .9665, .9669, .7291, .1239, .0125, .0014,
        .0001
    };
	
    /* Pan of landsat_8 */
    static const float sr5[84] = {
        .0000, .0001, .0010, .0032, .0090, .0330, .1243, .3979,
        .7148, .8242, .8490, .8612, .8582, .8571, .8606, .8515,
        .8573, .8607, .8603, .8718, .8887, .9042, .9117, .9064,
        .9199, .9162, .8927, .8781, .8757, .8724, .8899, .8800,
        .8824, .9024, .9076, .9141, .9196, .9227, .9301, .9432,
        .9403, .9449, .9425, .9431, .9338, .9393, .9524, .9678,
        .9679, .9593, .9493, .9503, .9558, .9637, .9659, .9749,
        .9779, .9693, .9729, .9678, .9668, .9690, .9810, .9728,
        .9533, .9607, .9695, .9686, .9771, .9890, .9880, .9993,
        .9991, .9946, .9859, .9348, .6102, .2170, .0576, .0190,
        .0077, .0038, .0015, .0001
    };
	
    /* Nir of landsat_8 */
    static const float sr6[27] = {
        .0000, .0002, .0005, .0012, .0032, .0090, .0283, .1149,
        .4035, .8177, .9868, .9884, .9898, .9740, .9512, .9523,
        .9401, .9613, .9366, .7120, .2888, .0793, .0207, .0062,
        .0019, .0006, .0001
    };
	
    /* Cirrus of landsat_8 */
    static const float sr7[27] = {
        .0000, .0000, .0003, .0006, .0013, .0023, .0047, .0111,
        .0345, .1154, .3867, .7721, .9009, .9312, .9917, 1.0000,
        .9771, .8713, .6549, .2979, .0896, .0261, .0083, .0028,
        .0011, .0002, .0000
    };
	
    /* SWIR1 of landsat_8 */
    static const float sr8[74] = {
        .0000, .0000, .0002, .0005, .0008, .0014, .0020, .0029,
        .0040, .0055, .0079, .0110, .0153, .0218, .0326, .0479,
        .0709, .1019, .1509, .2203, .3106, .4215, .5522, .6767,
        .7715, .8541, .8958, .9130, .9251, .9264, .9238, .9228,
        .9224, .9266, .9434, .9462, .9473, .9529, .9514, .9590,
        .9592, .9615, .9605, .9647, .9700, .9769, .9813, .9886,
        .9990, .9996, .9898, .9671, .9267, .8410, .7231, .5732,
        .4230, .2918, .1960, .1285, .0828, .0528, .0346, .0225,
        .0147, .0096, .0064, .0043, .0028, .0018, .0011, .0007,
        .0004, .0001
    };
	
    /* SWIR2 of landsat_8 */
    static const float sr9[125] = {
        .0000, .0001, .0003, .0004, .0007, .0009, .0013, .0017,
        .0023, .0030, .0039, .0051, .0067, .0089, .0116, .0150,
        .0199, .0259, .0337, .0454, .0598, .0794, .1067, .1447,
        .1912, .2537, .3269, .4126, .5056, .5932, .6764, .7565,
        .8032, .8463, .8757, .8861, .9081, .9180, .9310, .9414,
        .9430, .9452, .9492, .9494, .9549, .9491, .9492, .9471,
        .9555, .9478, .9516, .9450, .9419, .9450, .9384, .9470,
        .9459, .9493, .9370, .9388, .9368, .9271, .9337, .9280,
        .9361, .9351, .9514, .9520, .9638, .9635, .9633, .9607,
        .9578, .9533, .9553, .9603, .9498, .9606, .9525, .9600,
        .9656, .9655, .9793, .9842, .9883, .9977, .9926, 1.0000,
        .9958, .9877, .9876, .9780, .9735, .9762, .9740, .9599,
        .9551, .9472, .9148, .8836, .8044, .6985, .5776, .4527,
        .3356, .2446, .1739, .1220, .0861, .0607, .0434, .0312,
        .0226, .0166, .0122, .0090, .0067, .0050, .0037, .0027,
        .0019, .0013, .0009, .0006, .0003
    };
	
    static const float wli[9] = {0.4275, 0.4350, 0.5100, 0.6225, 0.4850, 0.8300, 1.3375, 1.5125, 2.0375};
    static const float wls[9] = {0.4625, 0.5275, 0.6025, 0.6850, 0.6950, 0.8975, 1.4050, 1.6975, 2.3500};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 14; i++)  ffu.s[71+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 37; i++)  ffu.s[74+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 37; i++)  ffu.s[104+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 25; i++)  ffu.s[149+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 84; i++)  ffu.s[94+i] = sr5[i];
        break;
    case 6: for(i = 0; i < 27; i++)  ffu.s[232+i] = sr6[i];
        break;
    case 7: for(i = 0; i < 27; i++)  ffu.s[435+i] = sr7[i];
        break;
    case 8: for(i = 0; i < 74; i++)  ffu.s[505+i] = sr8[i];
        break;
    case 9: for(i = 0; i < 125; i++)  ffu.s[715+i] = sr9[i];
        break;
    }
}

void IWave::geoeye1(int iwa)
{
    /* "Panchromatic" of geoeye1 */
    static const float sr1[216] = {
        .0000, .0001, .0001, .0004, .0007, .0027, .0046, .0863,
        .1679, .4137, .6595, .6918, .7240, .7334, .7428, .7525,
        .7622, .7650, .7679, .7528, .7378, .7411, .7443, .7345,
        .7247, .7443, .7638, .7579, .7520, .7812, .8105, .8202,
        .8299, .8051, .7802, .7983, .8164, .8400, .8636, .8480,
        .8325, .8532, .8739, .8670, .8601, .8408, .8216, .8401,
        .8586, .8624, .8661, .8594, .8527, .8830, .9134, .9046,
        .8959, .8935, .8912, .9079, .9246, .9236, .9226, .9300,
        .9375, .9355, .9335, .9372, .9409, .9505, .9601, .9559,
        .9516, .9537, .9557, .9621, .9684, .9765, .9847, .9869,
        .9890, .9792, .9693, .9744, .9796, .9898, 1.0000, .9886,
        .9772, .9706, .9641, .9722, .9804, .9813, .9823, .9745,
        .9666, .9669, .9672, .9730, .9787, .9610, .9434, .9406,
        .9378, .9368, .9358, .9411, .9463, .9588, .9714, .9646,
        .9577, .9439, .9301, .9266, .9232, .9256, .9279, .9167,
        .9055, .8945, .8834, .8836, .8839, .8859, .8878, .8823,
        .8767, .8675, .8583, .8486, .8389, .8350, .8310, .8382,
        .8454, .8521, .8588, .8479, .8370, .8163, .7957, .7838,
        .7719, .7910, .8100, .6449, .4797, .2768, .0738, .0443,
        .0148, .0102, .0057, .0037, .0018, .0013, .0008, .0006,
        .0004, .0004, .0004, .0004, .0003, .0003, .0003, .0003,
        .0004, .0003, .0003, .0003, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001

    };
	
    /* "Blue" of geoeye1 */
    static const float sr2[62] = {
        .0000, .0000, .0002, .0003, .0003, .0003, .0004, .0004,
        .0004, .0004, .0005, .0006, .0006, .0007, .0010, .0013,
        .0036, .0060, .0222, .0384, .1251, .2119, .4473, .6828,
        .7713, .8597, .8677, .8756, .8771, .8786, .8878, .8971,
        .9065, .9160, .9209, .9259, .9328, .9397, .9416, .9435,
        .9595, .9754, .9877, 1.0000, .9868, .9736, .7085, .4435,
        .2623, .0812, .0470, .0129, .0082, .0035, .0024, .0013,
        .0011, .0008, .0007, .0006, .0003, .0001
    };
	
    /* "Green" of geoeye1 */
    static const float sr3[82] = {
        .0000, .0000, .0001, .0003, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0003, .0003, .0003, .0003, .0003,
        .0004, .0004, .0005, .0005, .0011, .0016, .0117, .0219,
        .1132, .2045, .4832, .7619, .8086, .8554, .8617, .8680,
        .8817, .8955, .8955, .8955, .8957, .8960, .9002, .9044,
        .9032, .9020, .9193, .9366, .9503, .9641, .9762, .9883,
        .9942, 1.0000, .9882, .9763, .8664, .7564, .4210, .0857,
        .0462, .0067, .0040, .0014, .0010, .0006, .0005, .0004,
        .0004, .0003, .0003, .0003, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0003, .0003, .0003, .0003, .0003,
        .0002, .0000
    };
	
    /* "Red" of geoeye1 */
    static const float sr4[144] = {
        .0001, .0001, .0002, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0001, .0002, .0003, .0017, .0032, .0247,
        .0463, .2688, .4913, .7407, .9901, .9918, .9936, .9968,
        1.0000, .9856, .9713, .9688, .9663, .8722, .7781, .4300,
        .0819, .0431, .0044, .0025, .0007, .0004, .0002, .0001

    };
	
    /* "Near IR" of geoeye1 */
    static const float sr5[86] = {
        .0001, .0001, .0001, .0002, .0003, .0004, .0006, .0009,
        .0021, .0033, .0080, .0128, .0459, .0791, .2192, .3593,
        .6220, .8847, .9423, 1.0000, .9865, .9731, .9620, .9510,
        .9322, .9135, .8973, .8811, .8735, .8660, .8582, .8503,
        .8385, .8268, .8155, .8042, .7969, .7895, .7832, .7769,
        .7689, .7608, .7526, .7444, .7341, .7237, .7111, .6985,
        .6851, .6717, .6579, .6440, .6250, .6061, .5877, .5693,
        .5586, .5479, .5373, .5267, .5096, .4925, .4802, .4679,
        .4608, .4536, .4466, .4396, .4300, .4205, .3784, .3364,
        .2346, .1329, .0784, .0240, .0139, .0038, .0024, .0010,
        .0007, .0004, .0004, .0004, .0003, .0001
    };
	
    static const float wli[5] = {0.4300, 0.3975, 0.4475, 0.3550, 0.7425};
    static const float wls[5] = {0.9700, 0.5525, 0.6525, 0.7150, 0.9575};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 216; i++)  ffu.s[72+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 62; i++)  ffu.s[59+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 82; i++)  ffu.s[79+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 144; i++)  ffu.s[42+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 86; i++)  ffu.s[197+i] = sr5[i];
        break;
    }
}

void IWave::spot6(int iwa)
{

    /* Spot6 Blue of spot6 */
    static const float sr1[202] = {
        .0001, .0001, .0001, .0001, .0001, .0001, .0002, .0002,
        .0005, .0012, .0022, .0039, .0084, .0182, .0319, .0680,
        .1467, .2649, .4506, .6147, .7798, .8575, .8527, .8532,
        .8547, .8756, .9153, .9331, .9370, .9338, .9225, .9209,
        .9396, .9636, .9747, .9664, .9522, .9582, .9861, 1.0000,
        .9973, .9840, .9234, .8339, .6537, .4313, .2393, .1046,
        .0502, .0279, .0156, .0081, .0049, .0033, .0024, .0017,
        .0012, .0009, .0006, .0005, .0005, .0004, .0004, .0003,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0002, .0002, .0002, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0002, .0002, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0001,
        .0001, .0001
    };
	
    /* Spot6 Green of spot6 */
    static const float sr2[72] = {
        .0001, .0001, .0001, .0002, .0003, .0004, .0006, .0010,
        .0019, .0033, .0061, .0127, .0313, .0704, .1541, .3075,
        .5195, .7467, .9229, 1.0057, 1.0230, 1.0212, 1.0164, 1.0096,
        1.0029, .9996, 1.0026, 1.0091, 1.0100, .9990, .9815, .9702,
        .9709, .9807, .9944, .9991, .9871, .9639, .8850, .7236,
        .5325, .2984, .1244, .0510, .0246, .0118, .0055, .0025,
        .0013, .0008, .0006, .0004, .0003, .0002, .0002, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001

    };
	
    /* Spot6 Red of spot6 */
    static const float sr3[75] = {
        .0001, .0001, .0002, .0003, .0004, .0005, .0006, .0009,
        .0016, .0031, .0065, .0125, .0222, .0387, .0747, .1634,
        .3494, .5463, .7600, .9267, .9767, .9951, .9979, .9662,
        .9217, .8987, .9033, .9255, .9573, .9887, 1.0107, 1.0137,
        .9960, .9674, .9391, .9198, .9138, .9211, .9366, .9466,
        .9308, .8765, .7978, .6985, .5868, .4715, .3531, .2351,
        .1401, .0776, .0416, .0206, .0098, .0045, .0023, .0013,
        .0008, .0005, .0005, .0004, .0003, .0003, .0002, .0001,
        .0001, .0000, .0000, .0000, .0000, .0001, .0001, .0001,
        .0002, .0001, .0000
    };
	
    /* Spot6 NIR of spot6 */
    static const float sr4[200] = {
        .0000, .0000, .0008, .0008, .0010, .0000, .0000, .0000,
        .0001, .0001, .0001, .0001, .0000, .0000, .0000, .0000,
        .0001, .0001, .0001, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0001, .0001,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0003, .0003, .0003, .0003, .0003, .0004, .0005,
        .0006, .0006, .0004, .0003, .0001, .0001, .0001, .0001,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0001, .0001, .0001,
        .0001, .0001, .0002, .0002, .0003, .0004, .0005, .0007,
        .0010, .0014, .0019, .0028, .0042, .0065, .0104, .0170,
        .0290, .0496, .0862, .1462, .2549, .3877, .5465, .7084,
        .8466, .9436, .9893, 1.0000, .9932, .9834, .9753, .9694,
        .9633, .9552, .9448, .9330, .9201, .9087, .8988, .8904,
        .8829, .8749, .8643, .8520, .8377, .8224, .8081, .7954,
        .7842, .7751, .7670, .7592, .7514, .7431, .7336, .7233,
        .7118, .6987, .6841, .6699, .6567, .6454, .6366, .6299,
        .6230, .6150, .6053, .5943, .5805, .5570, .5102, .4427,
        .3607, .2673, .1717, .0941, .0480, .0243, .0132, .0074,
        .0046, .0029, .0020, .0014, .0011, .0008, .0007, .0006,
        .0005, .0004, .0003, .0003, .0002, .0002, .0001, .0001

    };
	
    /* Spot6 Pan of spot6 */
    static const float sr5[159] = {
        .0001, .0001, .0001, .0001, .0002, .0002, .0002, .0002,
        .0003, .0004, .0007, .0010, .0017, .0036, .0066, .0105,
        .0161, .0327, .0717, .1335, .2227, .3529, .5156, .6744,
        .7759, .8080, .8143, .8112, .8188, .8450, .8704, .8801,
        .8818, .8903, .9054, .9170, .9198, .9199, .9258, .9378,
        .9461, .9454, .9412, .9432, .9542, .9668, .9732, .9716,
        .9700, .9751, .9831, .9870, .9830, .9731, .9665, .9703,
        .9820, .9939, .9973, .9903, .9797, .9738, .9773, .9886,
        .9989, 1.0017, .9947, .9834, .9750, .9752, .9831, .9934,
        .9995, .9972, .9883, .9779, .9716, .9725, .9790, .9867,
        .9906, .9880, .9807, .9719, .9663, .9660, .9693, .9736,
        .9754, .9719, .9638, .9531, .9437, .9383, .9375, .9407,
        .9449, .9469, .9449, .9373, .9260, .9148, .9056, .9009,
        .9006, .9039, .9079, .9100, .9088, .9026, .8936, .8832,
        .8737, .8675, .8649, .8644, .8650, .8654, .8633, .8590,
        .8522, .8434, .8344, .8267, .8205, .8160, .8128, .8096,
        .8061, .7995, .7908, .7812, .7707, .7633, .7544, .7290,
        .6647, .5549, .4157, .2694, .1503, .0778, .0392, .0209,
        .0115, .0067, .0044, .0026, .0017, .0011, .0008, .0006,
        .0004, .0003, .0003, .0002, .0002, .0001, .0001
    };
	
    static const float wli[5] = {0.4075, 0.4875, 0.5825, 0.4425, 0.4000};
    static const float wls[5] = {0.9125, 0.6675, 0.7700, 0.9425, 0.7975};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 202; i++)  ffu.s[63+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 72; i++)  ffu.s[95+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 75; i++)  ffu.s[133+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 200; i++)  ffu.s[77+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 159; i++)  ffu.s[60+i] = sr5[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::spot7(int iwa)
{

    /* spot7 blue of spot7 */
    static const float sr1[229] = {
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0002, .0004, .0007,
        .0014, .0036, .0145, .0771, .2058, .3851, .5883, .7118,
        .7732, .8001, .8134, .8290, .8540, .8798, .8934, .9007,
        .9104, .9133, .9290, .9436, .9534, .9595, .9525, .9394,
        .9498, .9599, .9648, .9754, .9792, .9920, 1.0000, .9602,
        .8198, .6370, .4136, .1930, .0761, .0275, .0075, .0037,
        .0029, .0021, .0007, .0003, .0002, .0002, .0002, .0002,
        .0003, .0003, .0003, .0003, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0003, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0003, .0003, .0003, .0002, .0002,
        .0002, .0002, .0003, .0003, .0003, .0003, .0003, .0003,
        .0002, .0002, .0002, .0002, .0003, .0003, .0003, .0005,
        .0007, .0013, .0010, .0004, .0003, .0015, .0014, .0046,
        .0036, .0034, .0002, .0011, .0031, .0034, .0041, .0024,
        .0014, .0004, .0004, .0005, .0003, .0004, .0002, .0002,
        .0003, .0002, .0002, .0002, .0002, .0001, .0002, .0001,
        .0002, .0001, .0002, .0002, .0002, .0001, .0002, .0002,
        .0003, .0004, .0003, .0003, .0001, .0002, .0001, .0001,
        .0001, .0002, .0001, .0001, .0000, .0001, .0000, .0001,
        .0000, .0001, .0002, .0002, .0001, .0002, .0002, .0002,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0002, .0002, .0003, .0004, .0004,
        .0005, .0005, .0005, .0005, .0005, .0005, .0005, .0005,
        .0005, .0004, .0004, .0005, .0006, .0006, .0008, .0015,
        .0021, .0020, .0022, .0019, .0018, .0014, .0013, .0011,
        .0009, .0008, .0008, .0007, .0008, .0009, .0011, .0012,
        .0012, .0022, .0021, .0027, .0028, .0021, .0021, .0009,
        .0008, .0003, .0002, .0001, .0000
    };
	
    /* spot7 green of spot7 */
    static const float sr2[180] = {
        .0001, .0001, .0002, .0004, .0007, .0019, .0051, .0154,
        .0747, .2220, .4198, .6371, .7791, .8264, .8142, .8193,
        .8678, .9098, .9331, .9473, .9534, .9543, .9588, .9665,
        .9740, .9853, .9949, .9985, .9979, .9994, .9992, .9761,
        .9071, .8632, .7668, .6158, .5032, .3340, .1427, .0470,
        .0192, .0085, .0037, .0014, .0007, .0004, .0002, .0001,
        .0000, .0000, .0000, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0001, .0001, .0003, .0004, .0003, .0001,
        .0001, .0002, .0001, .0002, .0002, .0002, .0000, .0000,
        .0000, .0000, .0001, .0001, .0001, .0002, .0002, .0002,
        .0003, .0003, .0002, .0002, .0001, .0001, .0001, .0001,
        .0001, .0001, .0000, .0000, .0000, .0000, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0002,
        .0003, .0004, .0006, .0008, .0008, .0008, .0007, .0006,
        .0003, .0003, .0003, .0003, .0003, .0003, .0002, .0001,
        .0001, .0001, .0002, .0003, .0004, .0005, .0005, .0005,
        .0006, .0004, .0004, .0002, .0002, .0002, .0001, .0001,
        .0001, .0001, .0001, .0001
    };
	
    /* spot7 red of spot7 */
    static const float sr3[235] = {
        .0001, .0001, .0001, .0002, .0002, .0002, .0006, .0033,
        .0059, .0064, .0040, .0009, .0013, .0016, .0013, .0009,
        .0011, .0013, .0012, .0012, .0012, .0013, .0015, .0010,
        .0008, .0011, .0013, .0012, .0012, .0008, .0008, .0009,
        .0010, .0009, .0008, .0007, .0006, .0007, .0007, .0008,
        .0009, .0008, .0008, .0008, .0008, .0009, .0009, .0009,
        .0009, .0008, .0008, .0008, .0008, .0009, .0011, .0011,
        .0011, .0009, .0008, .0007, .0008, .0008, .0008, .0010,
        .0011, .0013, .0011, .0010, .0008, .0007, .0008, .0008,
        .0008, .0009, .0014, .0024, .0029, .0031, .0026, .0019,
        .0019, .0027, .0045, .0078, .0140, .0292, .0802, .1791,
        .2523, .3239, .3762, .3703, .3855, .4631, .5767, .6899,
        .7903, .8963, .9694, .9814, .9837, .9964, .9995, .9920,
        .9851, .9778, .9612, .9341, .9075, .8951, .9035, .9239,
        .9382, .9348, .9219, .9104, .9044, .8952, .8624, .7922,
        .6672, .5121, .3598, .2257, .1290, .0793, .0577, .0468,
        .0390, .0318, .0232, .0138, .0070, .0040, .0028, .0025,
        .0026, .0028, .0027, .0027, .0024, .0019, .0015, .0016,
        .0019, .0017, .0019, .0018, .0013, .0009, .0008, .0008,
        .0008, .0008, .0008, .0010, .0007, .0010, .0011, .0015,
        .0014, .0016, .0016, .0015, .0014, .0012, .0011, .0008,
        .0009, .0008, .0007, .0007, .0005, .0006, .0005, .0005,
        .0007, .0006, .0005, .0004, .0005, .0011, .0016, .0017,
        .0016, .0019, .0018, .0013, .0013, .0006, .0003, .0003,
        .0002, .0004, .0004, .0004, .0003, .0004, .0006, .0008,
        .0010, .0012, .0013, .0013, .0015, .0015, .0014, .0011,
        .0011, .0017, .0026, .0033, .0026, .0032, .0044, .0040,
        .0028, .0021, .0010, .0009, .0006, .0006, .0004, .0004,
        .0003, .0003, .0003, .0002, .0002, .0002, .0002, .0001,
        .0002, .0001, .0001
    };
	
    /* spot7 nir of spot7 */
    static const float sr4[219] = {
        .0000, .0000, .0001, .0003, .0004, .0005, .0005, .0004,
        .0004, .0003, .0003, .0004, .0005, .0008, .0009, .0009,
        .0008, .0006, .0007, .0010, .0013, .0019, .0021, .0022,
        .0018, .0013, .0010, .0008, .0005, .0003, .0003, .0002,
        .0001, .0001, .0001, .0001, .0002, .0002, .0002, .0002,
        .0002, .0003, .0003, .0003, .0003, .0001, .0004, .0007,
        .0010, .0010, .0006, .0003, .0005, .0008, .0010, .0011,
        .0008, .0006, .0007, .0010, .0013, .0013, .0010, .0006,
        .0004, .0002, .0002, .0002, .0003, .0003, .0003, .0003,
        .0002, .0002, .0003, .0005, .0007, .0009, .0009, .0010,
        .0007, .0004, .0002, .0001, .0002, .0001, .0001, .0002,
        .0001, .0001, .0001, .0002, .0001, .0001, .0002, .0002,
        .0001, .0001, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0001, .0002, .0001, .0001, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0001, .0001,
        .0001, .0001, .0002, .0002, .0002, .0002, .0003, .0003,
        .0004, .0005, .0006, .0007, .0010, .0015, .0024, .0039,
        .0065, .0113, .0202, .0353, .0606, .1026, .1796, .3276,
        .4949, .6522, .7976, .9149, .9645, .9593, .9472, .9500,
        .9614, .9741, .9798, .9945, .9989, .9942, .9787, .9669,
        .9546, .9411, .9290, .9171, .9071, .8970, .8867, .8749,
        .8603, .8429, .8247, .8050, .7864, .7700, .7573, .7482,
        .7402, .7312, .7216, .7074, .6893, .6667, .6404, .6118,
        .5830, .5529, .5224, .4938, .4658, .4379, .4077, .3707,
        .3252, .2748, .2212, .1662, .1137, .0696, .0391, .0211,
        .0120, .0073, .0049, .0035, .0029, .0024, .0021, .0018,
        .0016, .0014, .0012, .0010, .0007, .0005, .0004, .0003,
        .0002, .0001, .0001
    };
	
    /* spot7 pan of spot7 */
    static const float sr5[235] = {
        .0001, .0001, .0001, .0001, .0000, .0001, .0001, .0001,
        .0001, .0002, .0003, .0004, .0008, .0026, .0089, .0293,
        .0911, .2322, .4161, .5766, .6555, .6834, .7001, .7313,
        .7615, .7761, .7760, .7811, .7970, .8226, .8557, .8692,
        .8794, .8849, .8867, .8913, .8908, .8982, .9110, .9220,
        .9366, .9446, .9460, .9504, .9514, .9529, .9519, .9403,
        .9273, .9205, .9230, .9388, .9551, .9536, .9457, .9484,
        .9614, .9764, .9866, .9868, .9811, .9784, .9806, .9841,
        .9873, .9898, .9901, .9918, .9963, .9997, .9971, .9877,
        .9793, .9768, .9791, .9821, .9814, .9755, .9703, .9717,
        .9777, .9819, .9814, .9786, .9764, .9741, .9742, .9739,
        .9734, .9716, .9677, .9634, .9616, .9617, .9620, .9614,
        .9587, .9529, .9441, .9352, .9302, .9315, .9357, .9386,
        .9379, .9331, .9277, .9235, .9198, .9155, .9093, .8992,
        .8850, .8686, .8561, .8524, .8583, .8648, .8692, .8681,
        .8631, .8572, .8521, .8469, .8403, .8349, .8280, .8152,
        .7916, .7543, .7074, .6639, .6386, .6187, .5794, .5198,
        .4311, .3047, .1803, .1007, .0572, .0331, .0176, .0090,
        .0044, .0026, .0017, .0013, .0011, .0009, .0009, .0008,
        .0008, .0010, .0007, .0010, .0011, .0011, .0007, .0008,
        .0009, .0009, .0008, .0009, .0008, .0008, .0008, .0008,
        .0009, .0010, .0012, .0008, .0007, .0009, .0010, .0007,
        .0007, .0006, .0006, .0006, .0004, .0004, .0008, .0005,
        .0006, .0004, .0007, .0006, .0005, .0004, .0003, .0004,
        .0005, .0004, .0004, .0004, .0004, .0004, .0004, .0004,
        .0004, .0004, .0003, .0003, .0003, .0003, .0003, .0003,
        .0002, .0004, .0003, .0003, .0002, .0002, .0004, .0003,
        .0003, .0002, .0003, .0002, .0002, .0002, .0002, .0002,
        .0001, .0002, .0001, .0002, .0002, .0002, .0001, .0001,
        .0002, .0001, .0000
    };
	
    static const float wli[5] = {0.4000, 0.5075, 0.4000, 0.4025, 0.4050};
    static const float wls[5] = {0.9725, 0.9575, 0.9875, 0.9500, 0.9925};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 229; i++)  ffu.s[60+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 180; i++)  ffu.s[102+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 235; i++)  ffu.s[60+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 219; i++)  ffu.s[61+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 235; i++)  ffu.s[62+i] = sr5[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::pleiades1a(int iwa)
{

    /* Pleiades1a blue of pleiades1a */
    static const float sr1[208] = {
        .0100, .0296, .0886, .1300, .1355, .2482, .4389, .5185,
        .4758, .5178, .6596, .7786, .7959, .7725, .7796, .8094,
        .8324, .8437, .8410, .8332, .8250, .8246, .8369, .8711,
        .9167, .9474, .9601, .9669, .9748, .9730, .9684, .9664,
        .9744, .9903, 1.0000, .9938, .9817, .9813, .9671, .8859,
        .7175, .4994, .3052, .1740, .0953, .0549, .0349, .0264,
        .0232, .0225, .0212, .0175, .0120, .0074, .0047, .0034,
        .0026, .0020, .0015, .0011, .0007, .0005, .0004, .0004,
        .0005, .0010, .0014, .0014, .0009, .0003, .0001, .0001,
        .0001, .0001, .0001, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0001, .0002, .0005, .0008, .0010, .0007,
        .0005, .0004, .0006, .0012, .0016, .0017, .0010, .0004,
        .0002, .0001, .0001, .0001, .0001, .0000, .0000, .0001,
        .0001, .0000, .0001, .0001, .0001, .0001, .0002, .0002,
        .0004, .0005, .0007, .0008, .0007, .0005, .0004, .0003,
        .0003, .0003, .0002, .0002, .0002, .0003, .0003, .0004,
        .0005, .0006, .0008, .0012, .0018, .0031, .0056, .0105,
        .0168, .0214, .0218, .0179, .0138, .0108, .0090, .0081,
        .0080, .0081, .0090, .0103, .0127, .0164, .0224, .0311,
        .0416, .0503, .0537, .0489, .0395, .0294, .0215, .0164,
        .0130, .0109, .0095, .0085, .0078, .0075, .0073, .0074,
        .0075, .0077, .0079, .0079, .0078, .0073, .0067, .0058

    };
	
    /* Pleiades1a green of pleiades1a */
    static const float sr2[191] = {
        .0001, .0001, .0001, .0001, .0002, .0003, .0004, .0005,
        .0008, .0046, .0086, .0145, .0246, .0486, .1109, .2379,
        .4375, .6562, .8184, .8944, .9165, .9230, .9287, .9374,
        .9507, .9616, .9692, .9772, .9815, .9834, .9876, .9958,
        1.0000, .9973, .9849, .9679, .9538, .9542, .9675, .9818,
        .9868, .9724, .9345, .8829, .8441, .8255, .8103, .7517,
        .6227, .4368, .2572, .1376, .0778, .0485, .0346, .0270,
        .0215, .0162, .0108, .0061, .0031, .0016, .0008, .0005,
        .0003, .0002, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0002, .0002, .0002, .0002,
        .0001, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0001, .0002, .0002, .0002,
        .0001, .0001, .0001, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0001, .0000, .0000, .0001, .0001, .0001, .0002,
        .0004, .0010, .0042, .0067, .0079, .0069, .0030, .0011,
        .0007, .0006, .0005, .0005, .0005, .0006, .0008, .0011,
        .0017, .0031, .0056, .0092, .0126, .0146, .0143, .0119,
        .0091, .0069, .0057, .0053, .0054, .0061, .0068, .0084,
        .0108, .0141, .0186, .0234, .0276, .0301, .0304, .0290,
        .0269, .0250, .0240, .0235, .0239, .0248, .0260, .0271,
        .0270, .0257, .0230, .0191, .0150, .0111, .0081
    };
	
    /* Pleiades1a red of pleiades1a */
    static const float sr3[208] = {
        .0097, .0035, .0035, .0114, .0267, .0374, .0905, .0908,
        .0400, .0209, .0081, .0027, .0011, .0006, .0005, .0006,
        .0010, .0019, .0015, .0006, .0003, .0003, .0003, .0003,
        .0005, .0008, .0005, .0002, .0001, .0001, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0002, .0002, .0003, .0004, .0006, .0010, .0033,
        .0100, .0182, .0331, .0625, .1184, .2220, .3759, .5579,
        .7347, .8643, .9326, .9533, .9627, .9534, .9444, .9463,
        .9569, .9700, .9846, .9956, .9999, 1.0000, .9970, .9951,
        .9890, .9864, .9814, .9690, .9551, .9378, .9176, .8929,
        .8669, .8448, .8226, .7893, .7378, .6630, .5666, .4496,
        .3262, .2196, .1417, .0926, .0620, .0457, .0356, .0311,
        .0295, .0234, .0190, .0159, .0132, .0108, .0084, .0064,
        .0047, .0034, .0024, .0017, .0013, .0010, .0007, .0006,
        .0005, .0004, .0004, .0003, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0004, .0005, .0005, .0006, .0007,
        .0007, .0007, .0006, .0005, .0004, .0004, .0002, .0003,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0003, .0003, .0003, .0005, .0005, .0007,
        .0008, .0011, .0014, .0019, .0025, .0034, .0042, .0054,
        .0063, .0069, .0071, .0070, .0066, .0068, .0067, .0069,
        .0071, .0074, .0081, .0087, .0097, .0107, .0120, .0137,
        .0160, .0181, .0207, .0237, .0270, .0311, .0353, .0399,
        .0439, .0463, .0455, .0409, .0333, .0251, .0179, .0125

    };
	
    /* Pleiades1a nir of pleiades1a */
    static const float sr4[208] = {
        .0024, .0017, .0021, .0021, .0013, .0007, .0006, .0006,
        .0008, .0012, .0021, .0024, .0013, .0006, .0004, .0003,
        .0003, .0003, .0003, .0005, .0009, .0010, .0007, .0004,
        .0003, .0002, .0002, .0003, .0004, .0006, .0007, .0007,
        .0006, .0004, .0003, .0003, .0003, .0003, .0004, .0005,
        .0006, .0007, .0009, .0009, .0009, .0008, .0007, .0006,
        .0005, .0006, .0006, .0008, .0014, .0024, .0027, .0014,
        .0006, .0004, .0002, .0002, .0002, .0002, .0002, .0002,
        .0003, .0007, .0014, .0013, .0006, .0002, .0001, .0001,
        .0000, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0002, .0002, .0002, .0002,
        .0002, .0001, .0001, .0001, .0001, .0001, .0001, .0000,
        .0000, .0000, .0001, .0001, .0001, .0001, .0001, .0002,
        .0002, .0003, .0004, .0005, .0006, .0008, .0010, .0012,
        .0014, .0016, .0018, .0019, .0021, .0023, .0025, .0038,
        .0045, .0054, .0067, .0084, .0108, .0152, .0214, .0295,
        .0417, .0591, .0841, .1200, .1685, .2344, .3148, .4102,
        .5131, .6196, .7196, .8080, .8783, .9313, .9662, .9859,
        .9959, 1.0000, .9979, .9931, .9853, .9735, .9606, .9494,
        .9376, .9313, .9284, .9275, .9289, .9299, .9302, .9309,
        .9315, .9278, .9226, .9162, .9073, .8975, .8845, .8736,
        .8604, .8494, .8370, .8259, .8132, .7983, .7852, .7720,
        .7580, .7433, .7273, .7098, .6906, .6694, .6464, .6221,
        .5966, .5716, .5472, .5225, .4996, .4771, .4563, .4366,
        .4164, .3950, .3688, .3351, .2940, .2473, .1978, .1498,
        .1077, .0744, .0496, .0331, .0218, .0147, .0104, .0077

    };
	
    /* Pleiades1a pan of pleiades1a */
    static const float sr5[162] = {
        .0000, .0004, .0008, .0030, .0061, .0130, .0240, .0422,
        .0718, .1152, .1739, .2443, .3204, .3941, .4553, .5016,
        .5325, .5538, .5684, .5825, .5968, .6108, .6233, .6336,
        .6422, .6502, .6571, .6641, .6708, .6766, .6809, .6830,
        .6835, .6832, .6832, .6847, .6893, .6965, .7074, .7194,
        .7324, .7450, .7555, .7639, .7717, .7777, .7827, .7872,
        .7914, .7950, .7975, .7998, .8008, .8004, .8003, .8001,
        .8013, .8037, .8078, .8137, .8211, .8304, .8391, .8483,
        .8565, .8635, .8690, .8739, .8769, .8801, .8826, .8851,
        .8895, .8940, .8995, .9057, .9125, .9190, .9246, .9290,
        .9339, .9375, .9416, .9450, .9481, .9511, .9533, .9561,
        .9582, .9602, .9610, .9632, .9650, .9675, .9730, .9775,
        .9829, .9875, .9928, .9967, .9995, 1.0000, .9944, .9883,
        .9812, .9752, .9701, .9661, .9633, .9625, .9622, .9634,
        .9655, .9672, .9673, .9678, .9654, .9634, .9580, .9534,
        .9487, .9424, .9359, .9300, .9245, .9191, .9142, .9089,
        .9041, .8981, .8928, .8871, .8829, .8773, .8735, .8695,
        .8665, .8661, .8589, .8478, .8332, .8137, .7867, .7491,
        .6982, .6307, .5507, .4617, .3696, .2824, .2075, .1465,
        .1010, .0687, .0471, .0324, .0247, .0174, .0127, .0117,
        .0087, .0082
    };
	
    static const float wli[5] = {0.4300, 0.4725, 0.4300, 0.4300, 0.4475};
    static const float wls[5] = {0.9500, 0.9500, 0.9500, 0.9500, 0.8525};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 208; i++)  ffu.s[72+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 191; i++)  ffu.s[89+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 208; i++)  ffu.s[72+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 208; i++)  ffu.s[72+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 162; i++)  ffu.s[79+i] = sr5[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::pleiades1b(int iwa)
{

    /* Pleiades1b blue of pleiades1b */
    static const float sr1[208] = {
        .0016, .0013, .0043, .0111, .0176, .0234, .0574, .1346,
        .2238, .3085, .4616, .6508, .7554, .7477, .7168, .7185,
        .7567, .8101, .8422, .8234, .7752, .7527, .7802, .8199,
        .8517, .8603, .8587, .8658, .8828, .9040, .9197, .9326,
        .9502, .9758, .9950, 1.0000, .9951, .9806, .9417, .8436,
        .6711, .4633, .2889, .1671, .0902, .0505, .0315, .0238,
        .0213, .0206, .0196, .0168, .0114, .0067, .0041, .0030,
        .0024, .0020, .0016, .0011, .0013, .0008, .0006, .0004,
        .0004, .0004, .0005, .0011, .0020, .0012, .0004, .0001,
        .0001, .0001, .0001, .0001, .0001, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0001, .0002, .0008, .0011,
        .0008, .0004, .0004, .0004, .0007, .0016, .0024, .0010,
        .0003, .0002, .0001, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0001, .0000, .0001, .0001, .0001,
        .0002, .0003, .0004, .0007, .0009, .0007, .0006, .0004,
        .0003, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0003, .0004, .0004, .0005, .0007, .0010, .0016, .0026,
        .0046, .0091, .0172, .0238, .0215, .0159, .0120, .0095,
        .0079, .0072, .0072, .0076, .0084, .0099, .0123, .0163,
        .0226, .0320, .0444, .0547, .0564, .0480, .0358, .0258,
        .0189, .0144, .0117, .0099, .0086, .0078, .0072, .0070,
        .0069, .0069, .0070, .0073, .0074, .0075, .0075, .0071

    };
	
    /* Pleiades1b green of pleiades1b */
    static const float sr2[192] = {
        .0001, .0001, .0001, .0002, .0003, .0005, .0006, .0008,
        .0015, .0041, .0100, .0196, .0325, .0568, .1238, .2859,
        .5290, .7716, .8838, .9080, .9131, .9137, .9225, .9367,
        .9498, .9545, .9586, .9642, .9705, .9723, .9675, .9589,
        .9524, .9525, .9560, .9552, .9490, .9471, .9544, .9711,
        .9898, 1.0000, .9954, .9698, .9253, .8633, .7948, .7239,
        .6453, .5439, .4170, .2767, .1575, .0856, .0492, .0327,
        .0238, .0182, .0141, .0100, .0058, .0030, .0015, .0008,
        .0005, .0003, .0002, .0001, .0001, .0001, .0001, .0001,
        .0000, .0001, .0000, .0000, .0001, .0001, .0001, .0003,
        .0003, .0002, .0001, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0001,
        .0003, .0002, .0001, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0001, .0001, .0001, .0003, .0007, .0032, .0142,
        .0083, .0022, .0009, .0006, .0004, .0004, .0004, .0004,
        .0005, .0006, .0008, .0011, .0019, .0037, .0064, .0103,
        .0131, .0133, .0111, .0084, .0066, .0057, .0054, .0056,
        .0062, .0072, .0089, .0115, .0149, .0193, .0235, .0264,
        .0270, .0255, .0234, .0214, .0199, .0193, .0191, .0197,
        .0207, .0220, .0232, .0238, .0230, .0207, .0172, .0133

    };
	
    /* Pleiades1b red of pleiades1b */
    static const float sr3[208] = {
        .0005, .0009, .0005, .0012, .0051, .0080, .0067, .0109,
        .0247, .0654, .1225, .0570, .0214, .0128, .0063, .0024,
        .0009, .0005, .0004, .0004, .0005, .0008, .0010, .0006,
        .0004, .0003, .0002, .0003, .0004, .0005, .0005, .0004,
        .0003, .0002, .0001, .0001, .0001, .0001, .0001, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0001, .0001, .0001, .0001, .0001, .0002,
        .0002, .0002, .0007, .0012, .0021, .0038, .0068, .0123,
        .0222, .0413, .0781, .1519, .2777, .4510, .6291, .7625,
        .8329, .8579, .8659, .8693, .8752, .8858, .9006, .9175,
        .9349, .9478, .9570, .9623, .9648, .9624, .9613, .9620,
        .9699, .9812, .9934, 1.0000, .9810, .9523, .9132, .8694,
        .8252, .7830, .7361, .6735, .5878, .4805, .3630, .2523,
        .1626, .1022, .0641, .0419, .0285, .0205, .0154, .0121,
        .0099, .0083, .0071, .0061, .0052, .0043, .0035, .0028,
        .0036, .0030, .0023, .0018, .0013, .0010, .0008, .0006,
        .0005, .0004, .0004, .0004, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0003, .0004, .0004, .0005, .0006,
        .0006, .0007, .0007, .0006, .0005, .0005, .0004, .0003,
        .0003, .0003, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0003, .0003, .0003, .0003, .0004,
        .0005, .0006, .0008, .0010, .0013, .0018, .0024, .0033,
        .0044, .0057, .0069, .0078, .0083, .0084, .0082, .0081,
        .0080, .0078, .0078, .0080, .0082, .0085, .0088, .0093,
        .0098, .0101, .0104, .0104, .0102, .0095, .0086, .0073

    };
	
    /* Pleiades1b nir of pleiades1b */
    static const float sr4[208] = {
        .0002, .0008, .0004, .0005, .0017, .0027, .0012, .0007,
        .0007, .0008, .0008, .0010, .0015, .0022, .0020, .0010,
        .0005, .0003, .0002, .0002, .0002, .0003, .0004, .0006,
        .0006, .0004, .0003, .0002, .0002, .0002, .0002, .0002,
        .0004, .0006, .0007, .0006, .0005, .0004, .0004, .0004,
        .0004, .0005, .0006, .0006, .0007, .0008, .0008, .0007,
        .0006, .0006, .0005, .0005, .0005, .0006, .0007, .0012,
        .0023, .0029, .0020, .0008, .0004, .0002, .0001, .0001,
        .0001, .0001, .0001, .0001, .0002, .0003, .0005, .0008,
        .0007, .0003, .0002, .0001, .0001, .0001, .0000, .0000,
        .0000, .0000, .0000, .0000, .0001, .0001, .0001, .0001,
        .0001, .0002, .0002, .0002, .0002, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0002, .0002, .0003, .0003,
        .0004, .0005, .0006, .0008, .0010, .0012, .0014, .0016,
        .0018, .0020, .0023, .0025, .0029, .0052, .0064, .0080,
        .0101, .0131, .0171, .0229, .0310, .0427, .0592, .0835,
        .1179, .1664, .2311, .3159, .4172, .5285, .6410, .7472,
        .8386, .9088, .9594, .9881, 1.0000, .9992, .9896, .9677,
        .9514, .9375, .9255, .9152, .9088, .9026, .8967, .8925,
        .8855, .8777, .8676, .8569, .8474, .8360, .8237, .8130,
        .8016, .7922, .7828, .7769, .7715, .7631, .7543, .7452,
        .7349, .7255, .7146, .7031, .6919, .6816, .6705, .6595,
        .6476, .6292, .6111, .5934, .5761, .5600, .5449, .5306,
        .5155, .4977, .4734, .4388, .3934, .3368, .2743, .2114,
        .1536, .1063, .0704, .0459, .0295, .0193, .0127, .0085

    };
	
    /* Pleiades1b pan of pleiades1b */
    static const float sr5[203] = {
        .0001, .0001, .0002, .0004, .0008, .0028, .0056, .0120,
        .0221, .0389, .0664, .1067, .1614, .2272, .2987, .3678,
        .4258, .4697, .4992, .5193, .5333, .5467, .5603, .5736,
        .5855, .5957, .6041, .6120, .6188, .6256, .6319, .6378,
        .6422, .6444, .6449, .6449, .6451, .6468, .6513, .6591,
        .6691, .6812, .6937, .7056, .7158, .7251, .7324, .7384,
        .7439, .7493, .7536, .7581, .7611, .7639, .7652, .7662,
        .7666, .7675, .7688, .7723, .7771, .7834, .7917, .8015,
        .8110, .8200, .8291, .8365, .8427, .8482, .8519, .8555,
        .8583, .8620, .8667, .8716, .8780, .8847, .8913, .8989,
        .9046, .9105, .9155, .9208, .9253, .9290, .9329, .9370,
        .9401, .9442, .9469, .9503, .9521, .9543, .9574, .9608,
        .9663, .9721, .9788, .9846, .9912, .9957, .9991, 1.0000,
        .9963, .9915, .9870, .9817, .9771, .9746, .9729, .9739,
        .9742, .9769, .9798, .9828, .9846, .9851, .9837, .9826,
        .9790, .9746, .9697, .9648, .9598, .9533, .9484, .9445,
        .9397, .9345, .9297, .9248, .9183, .9112, .9061, .9006,
        .8953, .8908, .8895, .8885, .8810, .8708, .8567, .8369,
        .8102, .7729, .7190, .6529, .5711, .4796, .3846, .2948,
        .2166, .1531, .1057, .0717, .0491, .0338, .0257, .0182,
        .0132, .0122, .0090, .0084, .0043, .0033, .0027, .0022,
        .0018, .0015, .0014, .0012, .0011, .0010, .0009, .0009,
        .0008, .0007, .0007, .0007, .0006, .0006, .0006, .0006,
        .0006, .0005, .0005, .0005, .0005, .0004, .0004, .0004,
        .0005, .0004, .0004, .0004, .0004, .0004, .0004, .0003,
        .0004, .0003, .0003
    };
	
    static const float wli[5] = {0.4300, 0.4700, 0.4300, 0.4300, 0.4425};
    static const float wls[5] = {0.9500, 0.9500, 0.9500, 0.9500, 0.9500};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 208; i++)  ffu.s[72+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 192; i++)  ffu.s[88+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 208; i++)  ffu.s[72+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 208; i++)  ffu.s[72+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 203; i++)  ffu.s[77+i] = sr5[i];
        break;
    }
}


void IWave::worldview3(int iwa)
{

    /* Pan of worldview3 */
    static const float sr1[162] = {
        .0000, .0001, .0002, .0005, .0018, .0040, .0437, .0999,
        .2023, .3598, .4607, .4963, .5229, .5402, .5483, .5464,
        .5491, .5563, .5584, .5565, .5580, .5663, .5684, .5652,
        .5674, .5758, .5779, .5740, .5814, .5982, .6074, .6086,
        .6140, .6240, .6297, .6323, .6369, .6421, .6537, .6723,
        .6853, .6929, .6990, .7052, .7116, .7163, .7205, .7239,
        .7298, .7369, .7446, .7530, .7589, .7626, .7700, .7778,
        .7844, .7917, .7971, .8030, .8088, .8133, .8203, .8269,
        .8358, .8451, .8507, .8532, .8567, .8614, .8684, .8768,
        .8824, .8882, .8900, .8896, .8910, .8936, .9016, .9128,
        .9218, .9295, .9286, .9244, .9243, .9263, .9334, .9439,
        .9480, .9513, .9530, .9507, .9534, .9566, .9606, .9626,
        .9653, .9670, .9676, .9686, .9538, .9360, .9365, .9431,
        .9533, .9661, .9744, .9783, .9859, .9935, .9972, .9997,
        .9985, .9964, .9917, .9875, .9869, .9871, .9841, .9803,
        .9789, .9753, .9744, .9739, .9753, .9755, .9726, .9685,
        .9654, .9614, .9579, .9573, .9557, .9525, .9487, .9448,
        .9443, .9420, .9429, .9446, .9411, .9377, .9310, .9255,
        .9240, .9205, .8438, .7458, .5255, .2833, .1646, .0703,
        .0337, .0104, .0031, .0017, .0010, .0006, .0004, .0002,
        .0002, .0001
    };
	
    /* Coastal_MS7 of worldview3 */
    static const float sr2[34] = {
        .0000, .0000, .0002, .0006, .0025, .0226, .1048, .3527,
        .5648, .6403, .6701, .7018, .7234, .7547, .7860, .8122,
        .8297, .8511, .8795, .8988, .8979, .9066, .9363, .9680,
        .9882, 1.0000, .8771, .4725, .1212, .0196, .0037, .0011,
        .0003, .0001
    };
	
    /* Blue_MS4 of worldview3 */
    static const float sr3[176] = {
        .0000, .0001, .0002, .0004, .0008, .0020, .0052, .0145,
        .0523, .1391, .3701, .6262, .7571, .7961, .8125, .8259,
        .8327, .8311, .8464, .8596, .8824, .8860, .9003, .9034,
        .9042, .9240, .9537, .9661, .9668, .9831, .9967, .9997,
        .9531, .8053, .5343, .2451, .0889, .0348, .0099, .0041,
        .0016, .0007, .0004, .0003, .0002, .0001, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0003, .0003, .0001, .0001, .0001

    };
	
    /* Green_MS3 of worldview3 */
    static const float sr4[45] = {
        .0000, .0001, .0007, .0065, .0851, .4023, .6996, .7702,
        .7801, .8082, .7873, .8085, .8168, .8360, .8423, .7935,
        .8164, .8616, .8783, .8763, .8792, .8934, .9187, .9544,
        .9716, .9713, .9720, .9459, .9458, .9834, .9994, .9601,
        .7693, .4286, .1704, .0586, .0208, .0075, .0030, .0015,
        .0008, .0004, .0002, .0001, .0001
    };
	
    /* Yellow_MS6 of worldview3 */
    static const float sr5[165] = {
        .0000, .0000, .0002, .0007, .0037, .0342, .2139, .6005,
        .8636, .8941, .9078, .9180, .9227, .9286, .9467, .9433,
        .9607, .9878, .9963, .9933, .9959, .9587, .6899, .3138,
        .0944, .0261, .0093, .0036, .0016, .0007, .0004, .0002,
        .0001, .0001, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0001, .0003, .0005, .0008, .0019, .0057,
        .0055, .0016, .0005, .0002, .0001, .0001, .0001, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0001, .0001
    };
	
    /* Red_MS2 of worldview3 */
    static const float sr6[42] = {
        .0000, .0001, .0004, .0020, .0203, .1547, .4879, .8183,
        .9395, .9432, .9370, .9429, .9488, .9468, .9548, .9586,
        .9625, .9732, .9790, .9840, .9931, .9922, .9949, .9945,
        .9875, .9886, .9949, .9993, .9714, .8022, .4694, .1876,
        .0607, .0229, .0093, .0039, .0018, .0008, .0004, .0003,
        .0002, .0001
    };
	
    /* Red Edge_MS5 of worldview3 */
    static const float sr7[38] = {
        .0000, .0001, .0002, .0005, .0012, .0032, .0088, .0326,
        .1111, .3243, .6486, .8933, .9838, .9935, .9864, .9820,
        .9795, .9812, .9855, .9921, .9979, .9995, .9895, .9330,
        .7780, .4940, .2209, .0826, .0292, .0123, .0055, .0027,
        .0013, .0007, .0004, .0002, .0001, .0001
    };
	
    /* NIR1_MS1 of worldview3 */
    static const float sr8[76] = {
        .0001, .0001, .0001, .0003, .0006, .0013, .0027, .0053,
        .0104, .0231, .0588, .1652, .3962, .6715, .8709, .9739,
        1.0000, .9922, .9818, .9712, .9554, .9382, .9261, .9178,
        .9153, .9139, .9153, .9127, .9056, .8989, .8899, .8803,
        .8697, .8670, .8662, .8676, .8673, .8596, .8528, .8439,
        .8341, .8247, .8115, .7939, .7757, .7585, .7400, .7253,
        .7101, .6925, .6740, .6561, .6427, .6302, .6203, .6125,
        .6055, .6017, .6020, .6027, .5664, .4018, .2039, .0823,
        .0309, .0135, .0063, .0033, .0021, .0015, .0010, .0007,
        .0004, .0002, .0001, .0001
    };
	
    /* NIR2_MS8 of worldview3 */
    static const float sr9[89] = {
        .0000, .0001, .0021, .0050, .0071, .0155, .0519, .1987,
        .5721, .8996, .9942, .9981, .9767, .9538, .9337, .9134,
        .8942, .8730, .8531, .8382, .8188, .8047, .7914, .7726,
        .7577, .7403, .7301, .7191, .7061, .6928, .6801, .6680,
        .6568, .6439, .6304, .6170, .6000, .5864, .5722, .5544,
        .5405, .5268, .5100, .4928, .4761, .4612, .4439, .4297,
        .4132, .3972, .3822, .3674, .3515, .3365, .3214, .3091,
        .2956, .2844, .2740, .2628, .2523, .2411, .2303, .2218,
        .2105, .2013, .1933, .1836, .1755, .1660, .1567, .1508,
        .1429, .1366, .1304, .1232, .1151, .0999, .0731, .0419,
        .0195, .0082, .0035, .0017, .0008, .0005, .0003, .0002,
        .0001
    };
	
    /* SWIR1 of worldview3 */
    static const float sr10[63] = {
        .0000, .0000, .0002, .0003, .0003, .0004, .0004, .0005,
        .0007, .0008, .0011, .0015, .0021, .0030, .0044, .0068,
        .0111, .0188, .0331, .0607, .1164, .2198, .4033, .6350,
        .8383, .9524, .9828, .9904, .9904, .9880, .9882, .9949,
        .9986, .9536, .7801, .5373, .3037, .1597, .0858, .0470,
        .0273, .0163, .0103, .0067, .0046, .0032, .0023, .0017,
        .0013, .0010, .0009, .0007, .0006, .0005, .0004, .0004,
        .0004, .0003, .0003, .0003, .0003, .0003, .0001
    };
	
    /* SWIR2 of worldview3 */
    static const float sr11[56] = {
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0002, .0002, .0004, .0006, .0014, .0034,
        .0098, .0310, .1039, .2858, .6176, .9095, .9226, .8949,
        .9136, .9476, .9752, .9884, .9883, .9859, .9913, .9971,
        .9966, 1.0000, .9555, .7257, .4157, .1524, .0495, .0153,
        .0057, .0023, .0011, .0006, .0003, .0002, .0002, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001

    };
	
    /* SWIR3 of worldview3 */
    static const float sr12[39] = {
        .0000, .0001, .0001, .0002, .0003, .0005, .0013, .0033,
        .0101, .0339, .1087, .2884, .5790, .7930, .8898, .8970,
        .9117, .9246, .9352, .9474, .9610, .9773, .9953, .9989,
        .9866, .9786, .8403, .5534, .2201, .0665, .0197, .0062,
        .0025, .0011, .0005, .0003, .0001, .0000, .0001
    };
	
    /* SWIR4 of worldview3 */
    static const float sr13[50] = {
        .0000, .0001, .0001, .0002, .0002, .0003, .0004, .0007,
        .0011, .0019, .0034, .0064, .0131, .0284, .0659, .1419,
        .3122, .5747, .8196, .9650, .9582, .9516, .9666, .9852,
        .9952, .9995, .9999, .9997, .9949, .9868, .9743, .9339,
        .7642, .5640, .3207, .1506, .0712, .0328, .0161, .0082,
        .0045, .0026, .0015, .0009, .0006, .0004, .0003, .0001,
        .0001, .0001
    };
	
    /* SWIR5 of worldview3 */
    static const float sr14[54] = {
        .0001, .0002, .0001, .0000, .0001, .0000, .0002, .0001,
        .0003, .0005, .0008, .0014, .0027, .0054, .0119, .0282,
        .0703, .1534, .3105, .5282, .7231, .8960, .9577, .9628,
        .9709, .9846, .9959, .9999, .9898, .9701, .9473, .9435,
        .9416, .8180, .6295, .3992, .1832, .0741, .0302, .0124,
        .0059, .0029, .0016, .0009, .0005, .0003, .0003, .0001,
        .0001, .0002, .0001, .0000, .0001, .0000
    };
	
    /* SWIR6 of worldview3 */
    static const float sr15[51] = {
        .0000, .0001, .0001, .0001, .0001, .0001, .0003, .0004,
        .0006, .0011, .0019, .0033, .0063, .0125, .0283, .0650,
        .1343, .2683, .4892, .7200, .9225, .9984, .9977, .9954,
        .9949, .9915, .9896, .9825, .9642, .9341, .8872, .8615,
        .8581, .7748, .6345, .4488, .2272, .1005, .0451, .0194,
        .0093, .0047, .0026, .0015, .0009, .0005, .0004, .0003,
        .0002, .0001, .0001
    };
	
    /* SWIR7 of worldview3 */
    static const float sr16[47] = {
        .0000, .0001, .0001, .0001, .0003, .0006, .0012, .0025,
        .0061, .0156, .0468, .1112, .2458, .4584, .6318, .7693,
        .9092, .9488, .9662, .9842, .9932, .9963, .9989, 1.0000,
        .9969, .9914, .9850, .9769, .9635, .9483, .9148, .7730,
        .6197, .4182, .2046, .0865, .0340, .0125, .0053, .0024,
        .0012, .0006, .0003, .0002, .0001, .0001, .0001
    };
	
    /* SWIR8 of worldview3 */
    static const float sr17[83] = {
        .0000, .0001, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0003, .0003, .0003, .0004, .0005,
        .0009, .0014, .0025, .0049, .0100, .0217, .0479, .0922,
        .1664, .2868, .4459, .6204, .7669, .8738, .9340, .9624,
        .9784, .9885, .9946, .9984, 1.0000, .9993, .9970, .9937,
        .9905, .9896, .9899, .9885, .9839, .9739, .9568, .9309,
        .9055, .8919, .8997, .9116, .8201, .6699, .5134, .2892,
        .1348, .0631, .0270, .0123, .0058, .0030, .0017, .0010,
        .0006, .0005, .0003, .0003, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002
    };
	
    static const float wli[17] = {0.4300, 0.3825, 0.4250, 0.4975, 0.5675, 0.6150, 0.6800, 0.7400, 0.8425, 1.1375, 1.5025, 1.6125, 1.6675, 2.0975, 2.1375, 2.2025, 2.2300};
    static const float wls[17] = {0.8350, 0.4675, 0.8650, 0.6100, 0.9800, 0.7200, 0.7750, 0.9300, 1.0650, 1.2950, 1.6425, 1.7100, 1.7925, 2.2325, 2.2650, 2.3200, 2.4375};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 162; i++)  ffu.s[72+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 34; i++)  ffu.s[53+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 176; i++)  ffu.s[70+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 45; i++)  ffu.s[99+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 165; i++)  ffu.s[127+i] = sr5[i];
        break;
    case 6: for(i = 0; i < 42; i++)  ffu.s[146+i] = sr6[i];
        break;
    case 7: for(i = 0; i < 38; i++)  ffu.s[172+i] = sr7[i];
        break;
    case 8: for(i = 0; i < 76; i++)  ffu.s[196+i] = sr8[i];
        break;
    case 9: for(i = 0; i < 89; i++)  ffu.s[237+i] = sr9[i];
        break;
    case 10: for(i = 0; i < 63; i++)  ffu.s[355+i] = sr10[i];
        break;
    case 11: for(i = 0; i < 56; i++)  ffu.s[501+i] = sr11[i];
        break;
    case 12: for(i = 0; i < 39; i++)  ffu.s[545+i] = sr12[i];
        break;
    case 13: for(i = 0; i < 50; i++)  ffu.s[567+i] = sr13[i];
        break;
    case 14: for(i = 0; i < 54; i++)  ffu.s[739+i] = sr14[i];
        break;
    case 15: for(i = 0; i < 51; i++)  ffu.s[755+i] = sr15[i];
        break;
    case 16: for(i = 0; i < 47; i++)  ffu.s[781+i] = sr16[i];
        break;
    case 17: for(i = 0; i < 83; i++)  ffu.s[792+i] = sr17[i];
        break;
    }
}

/* Following filter function created using create_iwave.py */

void IWave::worldview4(int iwa)
{

    /* PAN of worldview4 */
    static const float sr1[300] = {
        .0006, .0004, .0003, .0003, .0003, .0003, .0002, .0003,
        .0003, .0006, .0005, .0004, .0005, .0004, .0004, .0004,
        .0004, .0005, .0004, .0004, .0005, .0006, .0006, .0009,
        .0010, .0013, .0023, .0026, .0042, .0085, .0106, .0189,
        .0496, .0763, .1245, .4001, .9077, 1.6745, 27.1900, 66.4800,
        173.1000, 371.5500, 532.6000, 651.1500, 724.4000, 747.4000, 748.4000, 725.4000,
        730.9000, 766.6000, 782.6000, 778.3500, 781.3000, 791.5000, 794.5000, 790.3500,
        789.3000, 791.2000, 793.9000, 797.3000, 801.4000, 806.1500, 806.1000, 801.8500,
        797.5000, 793.1500, 797.0000, 807.8000, 815.8000, 821.3500, 830.0000, 841.1500,
        848.7000, 853.2000, 853.5000, 850.4000, 848.3000, 846.9000, 846.0000, 845.6000,
        849.2000, 855.7000, 867.5000, 883.0000, 894.7000, 903.8000, 909.1000, 911.7500,
        912.6000, 912.1000, 911.8000, 911.6500, 912.1000, 912.8500, 918.1000, 926.2000,
        933.2000, 939.6500, 941.0000, 939.4500, 943.6000, 950.9000, 958.8000, 966.8500,
        967.2000, 963.4500, 958.0000, 951.7500, 954.2000, 961.2000, 972.6000, 986.2000,
        990.5000, 990.3500, 986.0000, 979.8500, 981.8000, 987.5500, 993.2000, 998.8500,
        996.0000, 989.3500, 982.8000, 976.3000, 977.5000, 981.8000, 986.7000, 991.7500,
        990.9000, 987.6500, 979.9000, 970.4000, 951.5000, 929.1500, 929.5000, 938.1500,
        945.1000, 951.5500, 950.6000, 947.1000, 950.0000, 954.8500, 959.3000, 963.5500,
        962.8000, 960.5500, 951.6000, 940.6000, 933.8000, 928.1500, 923.7000, 919.7000,
        917.5000, 915.7500, 911.8000, 907.4000, 899.2000, 890.1000, 882.0000, 874.0500,
        871.5000, 870.2500, 867.7000, 864.9000, 861.1000, 857.0000, 853.4000, 850.0000,
        847.5000, 845.2000, 843.2000, 841.1500, 837.6000, 833.7000, 825.7000, 816.4500,
        797.3000, 770.1500, 589.6000, 379.2500, 227.9000, 93.1300, 47.0400, 11.8300,
        3.4490, 1.7920, .9647, .5530, .3255, .2005, .1280, .0836,
        .0555, .0382, .0273, .0196, .0141, .0103, .0079, .0059,
        .0043, .0033, .0026, .0020, .0016, .0013, .0011, .0009,
        .0007, .0006, .0005, .0005, .0004, .0004, .0003, .0003,
        .0003, .0002, .0002, .0001, .0001, .0001, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0002, .0002, .0002, .0002, .0003,
        .0003, .0004, .0004, .0005
    };
	
    /* BLUE of worldview4 */
    static const float sr2[300] = {
        .0002, .0002, .0002, .0002, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0002, .0006, .0016, .0037,
        .0017, .0013, .0017, .0046, .0037, .0021, .0022, .0033,
        .0046, .0062, .0081, .0178, .0225, .0299, .0488, .1271,
        .4051, 1.0773, 1.9750, 4.2975, 22.2000, 121.9500, 363.4000, 660.7500,
        847.6000, 835.0500, 842.5000, 874.7500, 900.6000, 907.2000, 905.2000, 904.5500,
        921.4000, 927.7500, 936.3000, 943.5500, 944.9000, 937.1500, 943.7000, 949.4500,
        954.3000, 955.0500, 970.3000, 985.5000, 996.9000, 986.9000, 900.2000, 622.1000,
        307.2000, 124.7450, 48.3300, 17.3800, 7.9600, 3.9710, 2.1150, 1.1680,
        .6575, .3779, .2284, .1399, .0863, .0576, .0412, .0330,
        .0282, .0257, .0240, .0216, .0191, .0165, .0135, .0105,
        .0083, .0065, .0051, .0042, .0037, .0034, .0031, .0029,
        .0032, .0038, .0046, .0045, .0037, .0024, .0014, .0008,
        .0004, .0003, .0003, .0003, .0002, .0002, .0002, .0001,
        .0002, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0002, .0003, .0004, .0007, .0014, .0022, .0034, .0052,
        .0080, .0112, .0137, .0150, .0156, .0174, .0221, .0291,
        .0321, .0272, .0217, .0202, .0231, .0333, .0578, .1310,
        .3364, .3719, .1200, .0380, .0169, .0103, .0077, .0067,
        .0068, .0078, .0092, .0114, .0142, .0180, .0246, .0390,
        .0713, .1522, .2836, .3465, .2985, .2152, .1397, .0849,
        .0491, .0273, .0148, .0087, .0052, .0035, .0025, .0023,
        .0021, .0022, .0025, .0036, .0064, .0149, .0443, .2951,
        .2662, .0410, .0092, .0041, .0021, .0014, .0010, .0009,
        .0007, .0009, .0012, .0016, .0022, .0028, .0032, .0029,
        .0025, .0025, .0032, .0068, .0176, .0320, .0459, .0545,
        .0478, .0408, .0251, .0137, .0068, .0027, .0010, .0004,
        .0003, .0002, .0002, .0002, .0002, .0001, .0001, .0001,
        .0001, .0001, .0002, .0002, .0002, .0003, .0004, .0009,
        .0016, .0024, .0032, .0036, .0037, .0054, .0100, .0166,
        .0214, .0198, .0123, .0056, .0020, .0008, .0005, .0004,
        .0003, .0004, .0004, .0005, .0007, .0012, .0024, .0046,
        .0078, .0099, .0091, .0062, .0038, .0025, .0019, .0018,
        .0019, .0022, .0026, .0033, .0038, .0041, .0044, .0037,
        .0029, .0023, .0018, .0016, .0014, .0015, .0016, .0016,
        .0017, .0023, .0029, .0038, .0052, .0060, .0055, .0051,
        .0042, .0034, .0031, .0027, .0026, .0023, .0024, .0025,
        .0031, .0037, .0037, .0063
    };
	
    /* GREEN of worldview4 */
    static const float sr3[300] = {
        .0000, .0001, .0001, .0001, .0000, .0001, .0001, .0001,
        .0001, .0001, .0001, .0004, .0004, .0003, .0002, .0001,
        .0001, .0002, .0001, .0002, .0002, .0001, .0001, .0002,
        .0002, .0001, .0001, .0001, .0002, .0002, .0001, .0002,
        .0002, .0002, .0002, .0002, .0002, .0003, .0002, .0002,
        .0002, .0004, .0003, .0002, .0003, .0005, .0007, .0005,
        .0005, .0006, .0010, .0023, .0041, .0050, .0063, .0107,
        .0250, .0816, .2668, .7958, 2.2440, 15.6995, 107.2000, 531.2000,
        808.4000, 840.0000, 844.1000, 845.3500, 850.0000, 852.9500, 870.1000, 900.4000,
        911.8000, 902.2500, 899.4000, 912.4500, 914.1000, 897.8500, 888.5000, 899.7000,
        913.9000, 924.8000, 939.1000, 955.9000, 967.8000, 978.0500, 991.5000, 999.8500,
        997.7000, 995.7000, 969.6000, 779.7000, 445.3000, 185.9500, 62.1200, 21.0900,
        6.2660, 3.0140, 1.5690, .8639, .4572, .2479, .1353, .0793,
        .0499, .0342, .0255, .0205, .0171, .0142, .0113, .0085,
        .0061, .0044, .0033, .0025, .0020, .0018, .0016, .0016,
        .0015, .0015, .0014, .0012, .0010, .0008, .0006, .0005,
        .0005, .0005, .0004, .0004, .0005, .0005, .0006, .0006,
        .0007, .0007, .0009, .0009, .0010, .0012, .0011, .0009,
        .0005, .0002, .0001, .0001, .0001, .0000, .0000, .0001,
        .0001, .0000, .0000, .0001, .0000, .0000, .0000, .0001,
        .0002, .0007, .0010, .0006, .0006, .0005, .0005, .0005,
        .0005, .0004, .0009, .0019, .0027, .0010, .0006, .0003,
        .0003, .0003, .0004, .0004, .0003, .0002, .0004, .0021,
        .0015, .0005, .0003, .0002, .0001, .0002, .0003, .0004,
        .0002, .0004, .0013, .0064, .0010, .0001, .0003, .0058,
        .0086, .0150, .0020, .0105, .0061, .0074, .0068, .0044,
        .0059, .0029, .0039, .0026, .0022, .0033, .0022, .0020,
        .0020, .0008, .0021, .0025, .0017, .0010, .0025, .0021,
        .0017, .0017, .0013, .0013, .0014, .0025, .0017, .0016,
        .0018, .0017, .0017, .0016, .0010, .0011, .0013, .0006,
        .0006, .0006, .0008, .0006, .0005, .0005, .0006, .0004,
        .0004, .0004, .0003, .0003, .0002, .0003, .0002, .0003,
        .0003, .0002, .0002, .0002, .0003, .0002, .0003, .0003,
        .0003, .0004, .0004, .0004, .0005, .0006, .0006, .0006,
        .0006, .0006, .0005, .0005, .0005, .0005, .0005, .0005,
        .0006, .0006, .0008, .0009, .0012, .0016, .0021, .0028,
        .0036, .0047, .0058, .0070, .0084, .0101, .0116, .0133,
        .0149, .0168, .0191, .0215
    };
	
    /* RED of worldview4 */
    static const float sr4[285] = {
        .0000, .0001, .0383, .7053, .0358, .0092, .0032, .0001,
        .0001, .0000, .0000, .0000, .0000, .0001, .0000, .0000,
        .0000, .0000, .0001, .0107, .0254, .0006, .0275, .0105,
        .0027, .0177, .0003, .0003, .0003, .0064, .0008, .0007,
        .0220, .0008, .0036, .1027, .0042, .0000, .0001, .0000,
        .0000, .0000, .0000, .0000, .0001, .0000, .0000, .0001,
        .0000, .0000, .0006, .0010, .0001, .0002, .0006, .0001,
        .0002, .0008, .0004, .0002, .0007, .0005, .0001, .0004,
        .0010, .0005, .0009, .0031, .0013, .0010, .0023, .0020,
        .0013, .0011, .0002, .0001, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0001, .0000,
        .0001, .0001, .0001, .0001, .0002, .0002, .0002, .0003,
        .0005, .0008, .0015, .0032, .0082, .0227, .0774, .2953,
        1.5805, 14.3900, 141.0950, 563.0000, 897.4000, 931.3000, 927.6000, 934.5000,
        966.0000, 996.2000, 997.9000, 998.8000, 996.3500, 983.4000, 960.7500, 934.0000,
        900.5500, 478.4000, 98.1600, 12.3400, 2.4640, .6180, .2024, .0744,
        .0321, .0150, .0079, .0044, .0027, .0018, .0012, .0009,
        .0007, .0006, .0005, .0004, .0003, .0003, .0003, .0003,
        .0003, .0003, .0003, .0003, .0003, .0003, .0004, .0004,
        .0003, .0004, .0005, .0005, .0004, .0004, .0006, .0009,
        .0012, .0009, .0008, .0012, .0017, .0039, .0110, .0339,
        .0443, .0386, .0332, .0425, .0740, .0506, .0118, .0045,
        .0023, .0019, .0016, .0035, .0065, .0041, .0023, .0018,
        .0029, .0066, .0064, .0040, .0023, .0037, .0056, .0063,
        .0031, .0030, .0020, .0046, .0040, .0022, .0021, .0035,
        .0023, .0020, .0012, .0024, .0016, .0021, .0019, .0019,
        .0017, .0020, .0018, .0019, .0011, .0010, .0010, .0008,
        .0007, .0008, .0003, .0009, .0005, .0004, .0003, .0003,
        .0002, .0004, .0002, .0001, .0002, .0001, .0001, .0002,
        .0002, .0001, .0001, .0002, .0001, .0001, .0002, .0002,
        .0002, .0002, .0003, .0003, .0004, .0005, .0007, .0008,
        .0008, .0009, .0009, .0009, .0009, .0008, .0007, .0007,
        .0006, .0006, .0004, .0004, .0003, .0003, .0003, .0002,
        .0002, .0002, .0002, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0001, .0001, .0001, .0001, .0001,
        .0001, .0001, .0001, .0002, .0002
    };
	
    /* NIR of worldview4 */
    static const float sr5[253] = {
        .0000, .0001, .0003, .0000, .0000, .0004, .0002, .0000,
        .0001, .0000, .0000, .0001, .0000, .0001, .0001, .0001,
        .0038, .0035, .0005, .0001, .0002, .0010, .0020, .0008,
        .0002, .0002, .0005, .0051, .0042, .0007, .0005, .0046,
        .0185, .0029, .0158, .0197, .0007, .0011, .0030, .0000,
        .0000, .0000, .0000, .0001, .0000, .0001, .0001, .0000,
        .0000, .0001, .0000, .0000, .0000, .0001, .0001, .0000,
        .0001, .0000, .0001, .0005, .0001, .0000, .0000, .0002,
        .0005, .0003, .0003, .0002, .0000, .0001, .0002, .0007,
        .0006, .0004, .0003, .0004, .0004, .0006, .0008, .0010,
        .0018, .0006, .0001, .0001, .0002, .0002, .0001, .0000,
        .0000, .0001, .0001, .0000, .0000, .0001, .0001, .0003,
        .0004, .0004, .0004, .0003, .0003, .0003, .0003, .0004,
        .0003, .0002, .0001, .0001, .0002, .0002, .0002, .0002,
        .0002, .0002, .0002, .0002, .0003, .0002, .0002, .0002,
        .0002, .0002, .0004, .0007, .0008, .0008, .0007, .0008,
        .0010, .0014, .0022, .0035, .0054, .0068, .0077, .0089,
        .0112, .0155, .0241, .0386, .0645, .0989, .1433, .2049,
        .3111, .5073, .8975, 1.6600, 3.2385, 6.2560, 12.6250, 30.0100,
        72.9400, 169.0000, 385.7500, 711.4000, 944.5000, 998.7000, 955.8500, 902.2000,
        862.8500, 834.8000, 808.6000, 810.3000, 820.4000, 829.6000, 839.5500, 850.1000,
        860.4000, 871.8000, 885.0500, 883.9000, 879.0000, 874.4000, 868.7000, 861.7000,
        854.7500, 848.5000, 844.5500, 839.5000, 831.0000, 818.1000, 801.0000, 782.2000,
        765.1000, 750.5000, 737.1000, 722.9000, 706.3500, 687.6000, 667.6500, 649.4000,
        632.6500, 616.7000, 601.4500, 585.3000, 569.0000, 554.6000, 542.6500, 533.4000,
        526.2000, 519.7000, 513.0000, 505.9000, 498.9000, 491.3000, 483.5000, 476.1000,
        470.8500, 464.8000, 439.0000, 361.6000, 229.5500, 114.5000, 48.9100, 20.0800,
        9.9340, 5.4760, 3.5535, 2.3530, 1.4815, .6544, .3131, .1551,
        .0848, .0475, .0282, .0174, .0105, .0068, .0048, .0033,
        .0023, .0016, .0011, .0008, .0007, .0003, .0003, .0004,
        .0004, .0003, .0002, .0001, .0001, .0001, .0001, .0002,
        .0001, .0000, .0001, .0001, .0001
    };
	
    static const float wli[5] = {0.3500, 0.3500, 0.3500, 0.3875, 0.3925};
    static const float wls[5] = {1.1000, 1.1000, 1.1000, 1.1000, 1.0250};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 300; i++)  ffu.s[40+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 300; i++)  ffu.s[40+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 300; i++)  ffu.s[40+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 285; i++)  ffu.s[55+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 253; i++)  ffu.s[57+i] = sr5[i];
        break;
    }
}


void IWave::sentinel2a(int iwa)
{

    /* S2A_SR_AV_B1 of sentinel_2A_msi */
    static const float sr1[21] = {
        .0000, .0000, .0029, .0035, .0032, .0020, .0009, .0014,
        .0017, .0290, .4483, .7620, .8098, .8542, .9068, 1.0000,
        .9130, .8257, .4721, .0437, .0000
    };
	
    /* S2A_SR_AV_B2 of sentinel_2A_msi */
    static const float sr2[41] = {
        .0000, .0000, .0300, .0222, .0246, .0188, .0185, .0184,
        .0274, .1130, .5534, .7526, .7633, .8004, .8928, .9161,
        .8899, .8802, .9323, .9329, .8474, .7778, .7874, .8669,
        .9507, .9675, .9541, .9613, .9771, .9470, .8717, .8191,
        .8395, .9380, 1.0000, .8257, .3050, .0867, .0266, .0017,
        .0000
    };
	
    /* S2A_SR_AV_B3 of sentinel_2A_msi */
    static const float sr3[21] = {
        .0000, .0072, .0735, .4349, .8489, .9236, .8882, .8430,
        .8622, .9423, 1.0000, .9630, .8558, .7766, .7506, .7907,
        .8141, .5164, .1072, .0098, .0000
    };
	
    /* S2A_SR_AV_B4 of sentinel_2A_msi */
    static const float sr4[18] = {
        .0000, .0000, .0712, .7496, .9871, .9955, .9589, .8163,
        .7572, .8102, .8737, .9341, .9598, .9581, .9193, .4768,
        .0531, .0000
    };
	
    /* S2A_SR_AV_B5 of sentinel_2A_msi */
    static const float sr5[10] = {
        .0000, .0284, .5775, .9989, .9887, .9485, .8949, .7908,
        .1601, .0000
    };
	
    /* S2A_SR_AV_B6 of sentinel_2A_msi */
    static const float sr6[10] = {
        .0000, .0000, .1564, .8922, .9281, .9751, .9937, .9718,
        .4060, .0000
    };
	
    /* S2A_SR_AV_B7 of sentinel_2A_msi */
    static const float sr7[14] = {
        .0000, .0000, .0117, .2673, .8612, .9951, .9773, .8429,
        .7911, .8224, .7922, .5010, .0985, .0026
    };
	
    /* S2A_SR_AV_B8 of sentinel_2A_msi */
    static const float sr8[61] = {
        .0000, .0007, .0000, .0000, .0000, .0000, .0001, .0175,
        .0681, .1959, .5035, .8030, .9709, .9884, .9395, .9540,
        .9826, .9839, .9777, .9876, .9835, .9572, .9065, .8516,
        .7916, .7496, .7268, .7256, .7192, .7083, .7001, .7182,
        .7583, .7968, .8035, .7892, .7582, .7226, .6744, .6301,
        .5962, .5714, .5490, .5351, .5300, .5321, .5329, .5305,
        .5313, .5424, .5577, .5482, .4929, .4280, .4006, .4209,
        .4080, .2572, .0934, .0259, .0020
    };
	
    /* S2A_SR_AV_B8A of sentinel_2A_msi */
    static const float sr9[21] = {
        .0000, .0000, .0002, .0000, .0000, .0000, .0020, .0261,
        .1647, .6099, .9522, .9754, .9782, .9909, .9996, .9954,
        .9600, .4897, .0799, .0106, .0000
    };
	
    /* S2A_SR_AV_B9 of sentinel_2A_msi */
    static const float sr10[14] = {
        .0000, .0000, .0389, .3895, .9058, .9893, .9892, .9922,
        .9889, .9502, .8891, .4643, .0408, .0000
    };
	
    /* S2A_SR_AV_B10 of sentinel_2A_msi */
    static const float sr11[33] = {
        .0000, .0000, .0001, .0000, .0001, .0002, .0004, .0011,
        .0059, .0447, .2716, .6625, .8856, .9620, .9848, .9965,
        .9995, .9910, .9742, .9486, .9045, .8307, .5816, .2193,
        .0505, .0055, .0008, .0002, .0002, .0001, .0000, .0001,
        .0000
    };
	
    /* S2A_SR_AV_B11 of sentinel_2A_msi */
    static const float sr12[56] = {
        .0000, .0001, .0005, .0009, .0021, .0053, .0158, .0396,
        .0880, .1826, .3802, .6472, .8372, .8870, .8945, .9165,
        .9389, .9514, .9573, .9635, .9696, .9759, .9802, .9814,
        .9805, .9827, .9891, .9933, .9888, .9800, .9712, .9664,
        .9667, .9735, .9856, .9955, .9989, .9988, .9997, .9998,
        .9887, .9699, .9499, .9386, .9201, .8250, .5879, .3237,
        .1371, .0462, .0163, .0065, .0029, .0014, .0004, .0000

    };
	
    /* S2A_SR_AV_B12 of sentinel_2A_msi */
    static const float sr13[99] = {
        .0000, .0003, .0029, .0071, .0085, .0105, .0134, .0185,
        .0277, .0446, .0732, .1242, .2035, .3060, .4080, .4898,
        .5434, .5738, .5989, .6278, .6637, .7041, .7413, .7788,
        .8097, .8327, .8511, .8555, .8595, .8642, .8697, .8805,
        .8895, .8983, .9048, .9056, .9048, .9031, .9020, .9048,
        .9081, .9143, .9213, .9285, .9341, .9374, .9377, .9429,
        .9421, .9375, .9330, .9183, .9083, .9097, .9229, .9195,
        .9245, .9344, .9468, .9557, .9625, .9663, .9655, .9627,
        .9573, .9531, .9517, .9533, .9606, .9705, .9829, .9924,
        .9988, .9995, .9939, .9800, .9583, .9330, .9060, .8752,
        .8406, .8007, .7491, .6697, .5660, .4520, .3421, .2454,
        .1681, .1165, .0824, .0588, .0429, .0335, .0274, .0228,
        .0163, .0069, .0021
    };
	
    static const float wli[13] = {0.4075, 0.4350, 0.5350, 0.6425, 0.6925, 0.7275, 0.7650, 0.7575, 0.8325, 0.9275, 1.3325, 1.5425, 2.0750};
    static const float wls[13] = {0.4600, 0.5375, 0.5875, 0.6875, 0.7175, 0.7525, 0.8000, 0.9100, 0.8850, 0.9625, 1.4150, 1.6825, 2.3225};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 21; i++)  ffu.s[63+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 41; i++)  ffu.s[74+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 21; i++)  ffu.s[114+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 18; i++)  ffu.s[157+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 10; i++)  ffu.s[177+i] = sr5[i];
        break;
    case 6: for(i = 0; i < 10; i++)  ffu.s[191+i] = sr6[i];
        break;
    case 7: for(i = 0; i < 14; i++)  ffu.s[206+i] = sr7[i];
        break;
    case 8: for(i = 0; i < 61; i++)  ffu.s[203+i] = sr8[i];
        break;
    case 9: for(i = 0; i < 21; i++)  ffu.s[233+i] = sr9[i];
        break;
    case 10: for(i = 0; i < 14; i++)  ffu.s[271+i] = sr10[i];
        break;
    case 11: for(i = 0; i < 33; i++)  ffu.s[433+i] = sr11[i];
        break;
    case 12: for(i = 0; i < 56; i++)  ffu.s[517+i] = sr12[i];
        break;
    case 13: for(i = 0; i < 99; i++)  ffu.s[730+i] = sr13[i];
        break;
    }
}

void IWave::sentinel2b(int iwa)
{

    /* SR_AV_B1 of sentinel_2B_msi */
    static const float sr1[21] = {
        .0000, .0000, .0076, .0059, .0053, .0025, .0026, .0034,
        .0035, .0506, .5946, .8712, .9090, .9460, .9615, 1.0000,
        .9591, .8855, .4542, .0305, .0000
    };
	
    /* SR_AV_B2 of sentinel_2B_msi */
    static const float sr2[40] = {
        .0000, .0009, .0201, .0155, .0133, .0120, .0133, .0145,
        .0307, .1862, .6524, .8282, .8388, .8945, .9366, .9221,
        .8979, .9149, .9188, .8927, .8578, .8507, .9040, .9581,
        .9993, .9896, .9782, .9582, .9248, .8973, .8919, .9178,
        .9535, .9922, .9816, .8147, .3326, .0963, .0322, .0022

    };
	
    /* SR_AV_B3 of sentinel_2B_msi */
    static const float sr3[21] = {
        .0000, .0000, .0261, .1695, .6992, .9455, .9359, .9015,
        .9150, .9640, .9997, .9766, .9082, .8476, .8319, .8488,
        .8728, .8097, .3521, .0590, .0026
    };
	
    /* SR_AV_B4 of sentinel_2B_msi */
    static const float sr4[18] = {
        .0000, .0000, .0739, .6036, .9209, .9112, .8981, .9025,
        .9217, .9542, .9865, .9998, .9752, .9456, .8678, .4935,
        .0688, .0008
    };
	
    /* SR_AV_B5 of sentinel_2B_msi */
    static const float sr5[11] = {
        .0000, .0000, .0573, .7091, .9912, .9913, .9709, .9345,
        .7672, .1073, .0000
    };
	
    /* SR_AV_B6 of sentinel_2B_msi */
    static const float sr6[10] = {
        .0000, .0174, .5842, .9164, .9398, .9786, 1.0000, .8192,
        .0520, .0000
    };
	
    /* SR_AV_B7 of sentinel_2B_msi */
    static const float sr7[14] = {
        .0000, .0000, .0747, .4790, .9421, .9557, .9931, .9839,
        .9372, .8869, .8022, .4818, .0415, .0000
    };
	
    /* SR_AV_B8 of sentinel_2B_msi */
    static const float sr8[56] = {
        .0000, .0000, .0030, .0393, .1496, .5284, .9050, .9466,
        .9799, .9982, .9985, .9756, .9517, .9463, .9421, .9040,
        .8526, .8193, .8037, .7756, .7423, .7166, .7265, .7560,
        .7817, .7829, .7804, .7817, .7776, .7592, .7338, .7062,
        .6740, .6362, .6032, .5866, .5815, .5757, .5710, .5709,
        .5754, .5794, .5757, .5594, .5459, .5409, .5320, .4968,
        .4561, .4444, .4402, .3356, .1742, .0698, .0242, .0031

    };
	
    /* SR_AV_B8A of sentinel_2B_msi */
    static const float sr9[15] = {
        .0000, .0008, .0323, .2572, .7963, .9841, .9990, .9972,
        .9832, .9740, .9582, .8364, .3774, .0562, .0016
    };
	
    /* SR_AV_B9 of sentinel_2B_msi */
    static const float sr10[13] = {
        .0000, .0121, .2550, .8373, .9494, .9974, .9803, .9738,
        .9279, .8551, .6211, .0948, .0017
    };
	
    /* SR_AV_B10 of sentinel_2B_msi */
    static const float sr11[32] = {
        .0000, .0001, .0001, .0001, .0002, .0003, .0008, .0048,
        .0421, .1953, .5416, .8805, .9800, .9977, .9978, .9842,
        .9670, .9513, .9392, .9352, .9011, .7493, .4241, .1101,
        .0129, .0016, .0004, .0002, .0002, .0001, .0002, .0000

    };
	
    /* SR_AV_B11 of sentinel_2B_msi */
    static const float sr12[58] = {
        .0000, .0001, .0003, .0007, .0013, .0027, .0064, .0171,
        .0521, .1397, .3312, .6062, .8367, .9466, .9751, .9769,
        .9724, .9691, .9716, .9789, .9842, .9839, .9804, .9763,
        .9763, .9820, .9905, .9959, .9934, .9849, .9752, .9705,
        .9738, .9830, .9945, 1.0000, .9950, .9858, .9796, .9825,
        .9906, .9894, .9617, .9080, .8576, .8434, .8446, .7568,
        .5117, .2569, .0947, .0291, .0106, .0046, .0022, .0011,
        .0004, .0000
    };
	
    /* SR_AV_B12 of sentinel_2B_msi */
    static const float sr13[98] = {
        .0000, .0002, .0023, .0059, .0095, .0146, .0232, .0372,
        .0632, .1107, .1938, .3172, .4861, .6721, .8143, .8863,
        .9012, .8924, .8833, .8827, .8958, .9128, .9300, .9434,
        .9480, .9481, .9455, .9419, .9438, .9462, .9484, .9507,
        .9519, .9526, .9528, .9538, .9552, .9580, .9609, .9641,
        .9629, .9607, .9577, .9531, .9554, .9554, .9528, .9486,
        .9484, .9466, .9428, .9389, .9448, .9485, .9514, .9553,
        .9501, .9497, .9574, .9739, .9687, .9676, .9687, .9700,
        .9679, .9655, .9623, .9594, .9610, .9637, .9659, .9689,
        .9734, .9772, .9810, .9833, .9879, .9932, .9975, 1.0000,
        .9932, .9687, .9158, .8319, .7091, .5640, .4259, .3098,
        .2182, .1494, .1042, .0741, .0529, .0380, .0270, .0138,
        .0026, .0000
    };
	
    static const float wli[13] = {0.4075, 0.4350, 0.5325, 0.6425, 0.6900, 0.7275, 0.7625, 0.7700, 0.8450, 0.9275, 1.3375, 1.5375, 2.0625};
    static const float wls[13] = {0.4600, 0.5350, 0.5850, 0.6875, 0.7175, 0.7525, 0.7975, 0.9100, 0.8825, 0.9600, 1.4175, 1.6825, 2.3075};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 21; i++)  ffu.s[63+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 40; i++)  ffu.s[74+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 21; i++)  ffu.s[113+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 18; i++)  ffu.s[157+i] = sr4[i];
        break;
    case 5: for(i = 0; i < 11; i++)  ffu.s[176+i] = sr5[i];
        break;
    case 6: for(i = 0; i < 10; i++)  ffu.s[191+i] = sr6[i];
        break;
    case 7: for(i = 0; i < 14; i++)  ffu.s[205+i] = sr7[i];
        break;
    case 8: for(i = 0; i < 56; i++)  ffu.s[208+i] = sr8[i];
        break;
    case 9: for(i = 0; i < 15; i++)  ffu.s[238+i] = sr9[i];
        break;
    case 10: for(i = 0; i < 13; i++)  ffu.s[271+i] = sr10[i];
        break;
    case 11: for(i = 0; i < 32; i++)  ffu.s[435+i] = sr11[i];
        break;
    case 12: for(i = 0; i < 58; i++)  ffu.s[515+i] = sr12[i];
        break;
    case 13: for(i = 0; i < 98; i++)  ffu.s[725+i] = sr13[i];
        break;
    }
}

void IWave::planetscope0c0d(int iwa)
{

    /* Blue of planetscope_0c_0d */
    static const float sr1[114] = {
        .0203, .0270, .0202, .0135, .0067, .0000, .0000, .0000,
        .0000, .0000, .0135, .0270, .0405, .0540, .0607, .0675,
        .0742, .0810, .2973, .5135, .7297, .9460, .9595, .9730,
        .9865, 1.0000, .9865, .9730, .9595, .9460, .9257, .9055,
        .8852, .8650, .8380, .8110, .7840, .7570, .7232, .6895,
        .6558, .6220, .5745, .5270, .4795, .4320, .3915, .3510,
        .3105, .2700, .2498, .2295, .2092, .1890, .1620, .1350,
        .1080, .0810, .0675, .0540, .0405, .0270, .0270, .0270,
        .0270, .0270, .0202, .0135, .0067, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0068, .0135, .0203, .0270, .0270, .0270,
        .0270, .0270, .0270, .0270, .0270, .0270, .0270, .0270,
        .0270, .0270
    };
	
    /* Green of planetscope_0c_0d */
    static const float sr2[98] = {
        .0218, .0290, .0732, .1175, .1618, .2060, .2427, .2795,
        .3162, .3530, .3750, .3970, .4190, .4410, .4485, .4560,
        .4635, .4710, .5002, .5295, .5587, .5880, .6322, .6765,
        .7208, .7650, .8017, .8385, .8753, .9120, .9267, .9415,
        .9563, .9710, .9782, .9855, .9928, 1.0000, .9852, .9705,
        .9557, .9410, .9190, .8970, .8750, .8530, .8310, .8090,
        .7870, .7650, .7355, .7060, .6765, .6470, .6102, .5735,
        .5368, .5000, .4632, .4265, .3897, .3530, .3087, .2645,
        .2202, .1760, .1615, .1470, .1325, .1180, .1032, .0885,
        .0737, .0590, .0590, .0590, .0590, .0590, .0515, .0440,
        .0365, .0290, .0290, .0290, .0290, .0290, .0365, .0440,
        .0515, .0590, .0590, .0590, .0590, .0590, .0663, .0735,
        .0807, .0880
    };
	
    /* Red of planetscope_0c_0d */
    static const float sr3[98] = {
        .0555, .0740, .0832, .0925, .1018, .1110, .1202, .1295,
        .1387, .1480, .1387, .1295, .1202, .1110, .1202, .1295,
        .1387, .1480, .1480, .1480, .1480, .1480, .1387, .1295,
        .1202, .1110, .1110, .1110, .1110, .1110, .1110, .1110,
        .1110, .1110, .1110, .1110, .1110, .1110, .1110, .1110,
        .1110, .1110, .1110, .1110, .1110, .1110, .1295, .1480,
        .1665, .1850, .2590, .3330, .4070, .4810, .5737, .6665,
        .7592, .8520, .8890, .9260, .9630, 1.0000, 1.0000, 1.0000,
        1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, .9815, .9630,
        .9445, .9260, .9168, .9075, .8982, .8890, .8798, .8705,
        .8612, .8520, .8427, .8335, .8242, .8150, .7873, .7595,
        .7317, .7040, .6577, .6115, .5653, .5190, .3985, .2780,
        .1575, .0370
    };
	
    /* NIR of planetscope_0c_0d */
    static const float sr4[102] = {
        .0750, .1000, .0750, .0500, .0250, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0250, .0500,
        .0750, .1000, .0750, .0500, .0250, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .1000, .2000,
        .3000, .4000, .5250, .6500, .7750, .9000, .9250, .9500,
        .9750, 1.0000, .9750, .9500, .9250, .9000, .8750, .8500,
        .8250, .8000, .8000, .8000, .8000, .8000, .7750, .7500,
        .7250, .7000, .7000, .7000, .7000, .7000, .6750, .6500,
        .6250, .6000, .5750, .5500, .5250, .5000, .4500, .4000,
        .3500, .3000, .2500, .2000, .1500, .1000
    };
	
    static const float wli[4] = {0.4075, 0.4475, 0.4575, 0.6275};
    static const float wls[4] = {0.6925, 0.6925, 0.7025, 0.8825};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 114; i++)  ffu.s[63+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 98; i++)  ffu.s[79+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 98; i++)  ffu.s[83+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 102; i++)  ffu.s[151+i] = sr4[i];
        break;
    }
}

void IWave::planetscope0e(int iwa)
{

    /* Blue of planetscope_0e */
    static const float sr1[236] = {
        .0130, .0147, .0165, .0183, .0200, .0168, .0135, .0102,
        .0070, .0083, .0095, .0107, .0120, .0188, .0255, .0323,
        .0390, .0730, .1070, .1410, .1750, .3500, .5250, .7000,
        .8750, .9062, .9375, .9688, 1.0000, .9992, .9985, .9978,
        .9970, .9840, .9710, .9580, .9450, .9177, .8905, .8632,
        .8360, .8033, .7705, .7377, .7050, .6600, .6150, .5700,
        .5250, .4853, .4455, .4057, .3660, .3458, .3255, .3052,
        .2850, .2657, .2465, .2272, .2080, .1898, .1715, .1532,
        .1350, .1237, .1125, .1013, .0900, .0860, .0820, .0780,
        .0740, .0717, .0695, .0673, .0650, .0628, .0605, .0583,
        .0560, .0545, .0530, .0515, .0500, .0503, .0505, .0507,
        .0510, .0522, .0535, .0548, .0560, .0600, .0640, .0680,
        .0720, .0770, .0820, .0870, .0920, .0983, .1045, .1108,
        .1170, .1203, .1235, .1268, .1300, .1265, .1230, .1195,
        .1160, .1118, .1075, .1033, .0990, .0775, .0560, .0345,
        .0130, .0097, .0065, .0032, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0003, .0005, .0008,
        .0010, .0023, .0035, .0047, .0060, .0060, .0060, .0060,
        .0060, .0055, .0050, .0045, .0040, .0040, .0040, .0040,
        .0040, .0047, .0055, .0063, .0070, .0085, .0100, .0115,
        .0130, .0135, .0140, .0145, .0150, .0145, .0140, .0135,
        .0130, .0120, .0110, .0100, .0090, .0083, .0075, .0067,
        .0060, .0057, .0055, .0053, .0050, .0050, .0050, .0050,
        .0050, .0050, .0050, .0050, .0050, .0050, .0050, .0050,
        .0050, .0050, .0050, .0050, .0050, .0050, .0050, .0050,
        .0050, .0047, .0045, .0043, .0040, .0037, .0035, .0033,
        .0030, .0027, .0025, .0023
    };
	
    /* Green of planetscope_0e */
    static const float sr2[236] = {
        .0050, .0053, .0055, .0057, .0060, .0055, .0050, .0045,
        .0040, .0043, .0045, .0047, .0050, .0060, .0070, .0080,
        .0090, .0163, .0235, .0307, .0380, .0752, .1125, .1497,
        .1870, .2047, .2225, .2403, .2580, .2880, .3180, .3480,
        .3780, .4163, .4545, .4928, .5310, .5670, .6030, .6390,
        .6750, .7127, .7505, .7883, .8260, .8530, .8800, .9070,
        .9340, .9475, .9610, .9745, .9880, .9910, .9940, .9970,
        1.0000, .9890, .9780, .9670, .9560, .9400, .9240, .9080,
        .8920, .8700, .8480, .8260, .8040, .7748, .7455, .7163,
        .6870, .6498, .6125, .5753, .5380, .4975, .4570, .4165,
        .3760, .3422, .3085, .2747, .2410, .2215, .2020, .1825,
        .1630, .1570, .1510, .1450, .1390, .1345, .1300, .1255,
        .1210, .1175, .1140, .1105, .1070, .1067, .1065, .1062,
        .1060, .1100, .1140, .1180, .1220, .1290, .1360, .1430,
        .1500, .1457, .1415, .1373, .1330, .1063, .0795, .0527,
        .0260, .0200, .0140, .0080, .0020, .0015, .0010, .0005,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0003, .0005, .0008,
        .0010, .0023, .0035, .0047, .0060, .0057, .0055, .0053,
        .0050, .0045, .0040, .0035, .0030, .0033, .0035, .0037,
        .0040, .0047, .0055, .0063, .0070, .0080, .0090, .0100,
        .0110, .0115, .0120, .0125, .0130, .0125, .0120, .0115,
        .0110, .0102, .0095, .0088, .0080, .0075, .0070, .0065,
        .0060, .0057, .0055, .0053, .0050, .0047, .0045, .0043,
        .0040, .0040, .0040, .0040, .0040, .0043, .0045, .0047,
        .0050, .0050, .0050, .0050, .0050, .0047, .0045, .0043,
        .0040, .0037, .0035, .0033, .0030, .0030, .0030, .0030,
        .0030, .0027, .0025, .0023
    };
	
    /* Red of planetscope_0e */
    static const float sr3[236] = {
        .0040, .0040, .0040, .0040, .0040, .0033, .0025, .0017,
        .0010, .0013, .0015, .0018, .0020, .0020, .0020, .0020,
        .0020, .0035, .0050, .0065, .0080, .0128, .0175, .0222,
        .0270, .0275, .0280, .0285, .0290, .0295, .0300, .0305,
        .0310, .0307, .0305, .0302, .0300, .0292, .0285, .0278,
        .0270, .0283, .0295, .0307, .0320, .0360, .0400, .0440,
        .0480, .0515, .0550, .0585, .0620, .0570, .0520, .0470,
        .0420, .0370, .0320, .0270, .0220, .0222, .0225, .0227,
        .0230, .0338, .0445, .0553, .0660, .1455, .2250, .3045,
        .3840, .5040, .6240, .7440, .8640, .8930, .9220, .9510,
        .9800, .9850, .9900, .9950, 1.0000, .9965, .9930, .9895,
        .9860, .9840, .9820, .9800, .9780, .9695, .9610, .9525,
        .9440, .9355, .9270, .9185, .9100, .9025, .8950, .8875,
        .8800, .8682, .8565, .8448, .8330, .8237, .8145, .8053,
        .7960, .7348, .6735, .6123, .5510, .4353, .3195, .2037,
        .0880, .0678, .0475, .0272, .0070, .0055, .0040, .0025,
        .0010, .0008, .0005, .0003, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0005, .0010, .0015,
        .0020, .0037, .0055, .0072, .0090, .0083, .0075, .0067,
        .0060, .0055, .0050, .0045, .0040, .0043, .0045, .0047,
        .0050, .0055, .0060, .0065, .0070, .0083, .0095, .0107,
        .0120, .0128, .0135, .0142, .0150, .0142, .0135, .0128,
        .0120, .0112, .0105, .0097, .0090, .0083, .0075, .0067,
        .0060, .0057, .0055, .0053, .0050, .0050, .0050, .0050,
        .0050, .0050, .0050, .0050, .0050, .0050, .0050, .0050,
        .0050, .0050, .0050, .0050, .0050, .0050, .0050, .0050,
        .0050, .0047, .0045, .0043, .0040, .0037, .0035, .0033,
        .0030, .0027, .0025, .0023
    };
	
    /* NIR of planetscope_0e */
    static const float sr4[186] = {
        .0015, .0020, .0015, .0010, .0005, .0000, .0003, .0005,
        .0008, .0010, .0010, .0010, .0010, .0010, .0013, .0015,
        .0018, .0020, .0027, .0035, .0043, .0050, .0040, .0030,
        .0020, .0010, .0010, .0010, .0010, .0010, .0013, .0015,
        .0018, .0020, .0020, .0020, .0020, .0020, .0018, .0015,
        .0013, .0010, .0013, .0015, .0018, .0020, .0020, .0020,
        .0020, .0020, .0020, .0020, .0020, .0020, .0023, .0025,
        .0027, .0030, .0033, .0035, .0037, .0040, .0045, .0050,
        .0055, .0060, .0050, .0040, .0030, .0020, .0020, .0020,
        .0020, .0020, .0027, .0035, .0043, .0050, .0047, .0045,
        .0043, .0040, .0035, .0030, .0025, .0020, .0023, .0025,
        .0027, .0030, .0030, .0030, .0030, .0030, .0057, .0085,
        .0112, .0140, .0123, .0105, .0088, .0070, .0200, .0330,
        .0460, .0590, .0478, .0365, .0253, .0140, .0110, .0080,
        .0050, .0020, .0033, .0045, .0057, .0070, .0055, .0040,
        .0025, .0010, .0010, .0010, .0010, .0010, .0018, .0025,
        .0033, .0040, .0378, .0715, .1053, .1390, .3098, .4805,
        .6512, .8220, .8665, .9110, .9555, 1.0000, .9900, .9800,
        .9700, .9600, .9495, .9390, .9285, .9180, .9008, .8835,
        .8662, .8490, .8367, .8245, .8123, .8000, .7903, .7805,
        .7708, .7610, .7462, .7315, .7167, .7020, .6895, .6770,
        .6645, .6520, .6412, .6305, .6198, .6090, .5873, .5655,
        .5437, .5220, .4248, .3275, .2303, .1330, .1018, .0705,
        .0393, .0080
    };
	
    static const float wli[4] = {0.4000, 0.4000, 0.4000, 0.4275};
    static const float wls[4] = {0.9900, 0.9900, 0.9900, 0.8925};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 236; i++)  ffu.s[60+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 236; i++)  ffu.s[60+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 236; i++)  ffu.s[60+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 186; i++)  ffu.s[71+i] = sr4[i];
        break;
    }
}

void IWave::planetscope0f10(int iwa)
{

    /* Blue of planetscope_0f_10 */
    static const float sr1[113] = {
        .0040, .0040, .0040, .0040, .0040, .0040, .0040, .0040,
        .0040, .0043, .0045, .0047, .0050, .0063, .0075, .0088,
        .0100, .1258, .2415, .3572, .4730, .5952, .7175, .8397,
        .9620, .9702, .9785, .9868, .9950, .9962, .9975, .9988,
        1.0000, .9855, .9710, .9565, .9420, .9137, .8855, .8572,
        .8290, .7997, .7705, .7412, .7120, .6713, .6305, .5897,
        .5490, .5060, .4630, .4200, .3770, .3540, .3310, .3080,
        .2850, .2675, .2500, .2325, .2150, .1975, .1800, .1625,
        .1450, .1327, .1205, .1082, .0960, .0912, .0865, .0818,
        .0770, .0740, .0710, .0680, .0650, .0628, .0605, .0583,
        .0560, .0545, .0530, .0515, .0500, .0498, .0495, .0493,
        .0490, .0500, .0510, .0520, .0530, .0560, .0590, .0620,
        .0650, .0698, .0745, .0793, .0840, .0897, .0955, .1013,
        .1070, .1110, .1150, .1190, .1230, .1080, .0930, .0780,
        .0630
    };
	
    /* Green of planetscope_0f_10 */
    static const float sr2[113] = {
        .0040, .0040, .0040, .0040, .0040, .0040, .0040, .0040,
        .0040, .0040, .0040, .0040, .0040, .0043, .0045, .0047,
        .0050, .0288, .0525, .0762, .1000, .1260, .1520, .1780,
        .2040, .2145, .2250, .2355, .2460, .2765, .3070, .3375,
        .3680, .4045, .4410, .4775, .5140, .5495, .5850, .6205,
        .6560, .6955, .7350, .7745, .8140, .8450, .8760, .9070,
        .9380, .9517, .9655, .9792, .9930, .9948, .9965, .9982,
        1.0000, .9935, .9870, .9805, .9740, .9592, .9445, .9298,
        .9150, .8912, .8675, .8438, .8200, .7927, .7655, .7382,
        .7110, .6750, .6390, .6030, .5670, .5250, .4830, .4410,
        .3990, .3635, .3280, .2925, .2570, .2355, .2140, .1925,
        .1710, .1645, .1580, .1515, .1450, .1397, .1345, .1293,
        .1240, .1205, .1170, .1135, .1100, .1085, .1070, .1055,
        .1040, .1065, .1090, .1115, .1140, .1023, .0905, .0788,
        .0670
    };
	
    /* Red of planetscope_0f_10 */
    static const float sr3[117] = {
        .0010, .0010, .0010, .0010, .0010, .0010, .0010, .0010,
        .0010, .0010, .0010, .0010, .0010, .0010, .0010, .0010,
        .0010, .0055, .0100, .0145, .0190, .0217, .0245, .0272,
        .0300, .0297, .0295, .0293, .0290, .0298, .0305, .0312,
        .0320, .0318, .0315, .0312, .0310, .0302, .0295, .0288,
        .0280, .0288, .0295, .0302, .0310, .0353, .0395, .0437,
        .0480, .0528, .0575, .0622, .0670, .0625, .0580, .0535,
        .0490, .0428, .0365, .0303, .0240, .0232, .0225, .0218,
        .0210, .0278, .0345, .0413, .0480, .1067, .1655, .2243,
        .2830, .4165, .5500, .6835, .8170, .8582, .8995, .9407,
        .9820, .9865, .9910, .9955, 1.0000, .9950, .9900, .9850,
        .9800, .9798, .9795, .9792, .9790, .9705, .9620, .9535,
        .9450, .9385, .9320, .9255, .9190, .9085, .8980, .8875,
        .8770, .8660, .8550, .8440, .8330, .7240, .6150, .5060,
        .3970, .2980, .1990, .1000, .0010
    };
	
    /* NIR of planetscope_0f_10 */
    static const float sr4[174] = {
        .0015, .0020, .0020, .0020, .0020, .0020, .0018, .0015,
        .0013, .0010, .0008, .0005, .0003, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0003, .0005,
        .0008, .0010, .0013, .0015, .0018, .0020, .0018, .0015,
        .0013, .0010, .0010, .0010, .0010, .0010, .0013, .0015,
        .0018, .0020, .0020, .0020, .0020, .0020, .0020, .0020,
        .0020, .0020, .0018, .0015, .0013, .0010, .0008, .0005,
        .0003, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0003, .0005,
        .0008, .0010, .0013, .0015, .0018, .0020, .0023, .0025,
        .0027, .0030, .0030, .0030, .0030, .0030, .0030, .0030,
        .0030, .0030, .0027, .0025, .0023, .0020, .0015, .0010,
        .0005, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0000, .0000, .0000, .0000, .0000, .0000,
        .0000, .0000, .0003, .0005, .0008, .0010, .0025, .0040,
        .0055, .0070, .0457, .0845, .1232, .1620, .3700, .5780,
        .7860, .9940, .9955, .9970, .9985, 1.0000, .9810, .9620,
        .9430, .9240, .9103, .8965, .8828, .8690, .8552, .8415,
        .8277, .8140, .8002, .7865, .7728, .7590, .7470, .7350,
        .7230, .7110, .6972, .6835, .6698, .6560, .6430, .6300,
        .6170, .6040, .5922, .5805, .5688, .5570, .4775, .3980,
        .3185, .2390, .1802, .1215, .0628, .0040
    };
	
    static const float wli[4] = {0.4000, 0.4000, 0.4000, 0.4475};
    static const float wls[4] = {0.6825, 0.6825, 0.6925, 0.8825};

    ffu.wlinf = (float)wli[iwa-1];
    ffu.wlsup = (float)wls[iwa-1];

    int i;
    for(i = 0; i < 1501; i++) ffu.s[i] = 0;

    switch(iwa)
    {
    case 1: for(i = 0; i < 113; i++)  ffu.s[60+i] = sr1[i];
        break;
    case 2: for(i = 0; i < 113; i++)  ffu.s[60+i] = sr2[i];
        break;
    case 3: for(i = 0; i < 117; i++)  ffu.s[60+i] = sr3[i];
        break;
    case 4: for(i = 0; i < 174; i++)  ffu.s[79+i] = sr4[i];
        break;
    }
}


/* filter functions must be defined above */

double IWave::equivwl() const
{
    double seb = 0;
    double wlwave = 0;

    for(int i = iinf; i <= isup; i++)
    {
	double sbor = ffu.s[i];
	if(i == iinf || i == isup) sbor *= 0.5;
	double fwl = (double)(0.25 + i * step);
	double swl = solirr(fwl);
	double coef = sbor * step * swl;
	seb += coef;
	wlwave += fwl * coef;
    }

    return wlwave/seb;
}

void IWave::parse()
{
    iinf = 0;
    isup = 1500;

    int i;
    for(i = 0; i <= isup; i++) ffu.s[i] = 1;

    cin >> iwave;
    cin.ignore(numeric_limits<int>::max(),'\n');
	
    if(iwave == 0 || iwave == -2)
    {
	cin >> ffu.wlinf;
	cin >> ffu.wlsup;
	cin.ignore(numeric_limits<int>::max(),'\n');
    }  
    else if(iwave < 0)	/* excludes -2 */
    {
	cin >> wl;
	cin.ignore(numeric_limits<int>::max(),'\n');
	ffu.wlinf = wl;
	ffu.wlsup = wl;
    } 
    else
    {
	/* da big switch */
	if(iwave == 1)
	{
	    cin >> ffu.wlinf;
	    cin >> ffu.wlsup;
	    cin.ignore(numeric_limits<int>::max(),'\n');
	    /* moved rest further on */
	}
	else if(iwave == 2)	meteo();
	else if(iwave == 3)	goes_east();
	else if(iwave == 4)	goes_west();
	else if(iwave <= 16)	avhrr(iwave - 4);
	else if(iwave <= 24)	hrv(iwave - 16);
	else if(iwave <= 30)	tm(iwave - 24);
	else if(iwave <= 34)	mss(iwave - 30);
	else if(iwave <= 41)	mas(iwave - 34);
	else if(iwave <= 48)	modis(iwave - 41);
	else if(iwave <= 52)	avhrr(iwave - 36);
	else if(iwave <= 60)	polder(iwave - 52);
	else if(iwave <= 67)	etmplus(iwave - 60);
	else if(iwave <= 71)	irs_1c_liss(iwave - 67);
	else if(iwave <= 80)	aster(iwave - 71);
	else if(iwave <= 84)    avnir(iwave - 80);
	else if(iwave <= 87)    ikonos(iwave - 84);
	else if(iwave <= 92)    rapideye(iwave - 87);
	else if(iwave <= 96)    vgt1_spot4(iwave - 92);
	else if(iwave <= 100)   vgt2_spot5(iwave - 96);
	else if(iwave <= 109)   worldview2(iwave - 100);
	else if(iwave <= 114)   quickbird2(iwave - 109);
	else if(iwave <= 123)	landsat_8(iwave - 114);
	else if(iwave <= 128)	geoeye1(iwave - 123);
	else if(iwave <= 133)	spot6(iwave - 128);
	else if(iwave <= 138)	spot7(iwave - 133);
	else if(iwave <= 143)	pleiades1a(iwave - 138);
	else if(iwave <= 148)	pleiades1b(iwave - 143);
	else if(iwave <= 165)   worldview3(iwave - 148);
	else if(iwave <= 178)   sentinel2a(iwave - 165);
	else if(iwave <= 191)   sentinel2b(iwave - 178);
	else if(iwave <= 195)   planetscope0c0d(iwave - 191);
	else if(iwave <= 199)   planetscope0e(iwave - 195);
	else if(iwave <= 203)   planetscope0f10(iwave - 199);
	else if(iwave <= 208)   worldview4(iwave - 203);
	else G_warning(_("Unsupported iwave value: %d"), iwave);

	if (iwave > 1) {
	    int imax;
	    double smax, sthreshold;

	    imax = -1;
	    smax = 0;
	    sthreshold = 0.01; /* low threshold for filter functions */

	    /* find maximum response */
	    for(i = 0; i <= 1500; i++) {
		if (smax < ffu.s[i]) {
		    smax = ffu.s[i];
		    imax = i;
		}
	    }
	    if (smax < sthreshold)
		G_fatal_error("Invalid filter function");
	    
	    /* set wlinf, wlsup */
	    iinf = imax;
	    while (iinf > 0 && ffu.s[iinf - 1] > sthreshold) {
		iinf--;
	    }
	    ffu.wlinf = iinf * 0.0025 + 0.25;

	    isup = imax;
	    while (isup < 1500 && ffu.s[isup + 1] > sthreshold) {
		isup++;
	    }
	    ffu.wlsup = isup * 0.0025 + 0.25;
	}
    }

    /* assuming that wlinf and wlsup are exact multiples of 2.5 nm */
    iinf = (int)((ffu.wlinf - 0.25f) / 0.0025f + 1.5f) - 1;	/* remember indexing */
    isup = (int)((ffu.wlsup - 0.25f) / 0.0025f + 1.5f) - 1;	/*		   "         */

    if(iwave == 1)	/* moved here to avoid unnecessary gotos */
    {
	for(i = iinf; i <= isup; i++) cin >> ffu.s[i];
	cin.ignore(numeric_limits<int>::max(),'\n');
    }
}

/* --- spectral condition ---- */
void IWave::print()
{
/* The compiler will deduce the dimension from the initializer list. */ 
    static const string nsat[] = {
	string(" constant        "), string(" user s          "),
	string(" meteosat        "), string(" goes east       "), string(" goes west       "),
	string(" avhrr 1 (noaa6) "), string(" avhrr 2 (noaa6) "),
	string(" avhrr 1 (noaa7) "), string(" avhrr 2 (noaa7) "),
	string(" avhrr 1 (noaa8) "), string(" avhrr 2 (noaa8) "),
	string(" avhrr 1 (noaa9) "), string(" avhrr 2 (noaa9) "),
	string(" avhrr 1 (noaa10)"), string(" avhrr 2 (noaa10)"),
	string(" avhrr 1 (noaa11)"), string(" avhrr 2 (noaa11)"),
	string(" hrv1 1          "), string(" hrv1 2          "), string(" hrv1 3          "),
	string(" hrv1 pan        "),
	string(" hrv2 1          "), string(" hrv2 2          "), string(" hrv2 3          "),
	string(" hrv2 pan        "),
	string("  tm  1          "), string("  tm  2          "), string("  tm  3          "),
	string("  tm  4          "), string("  tm  5          "), string("  tm  7          "),
	string("  mss 4          "), string("  mss 5          "),
	string("  mss 6          "), string("  mss 7          "),
	string("  mas 1          "), string("  mas 2          "), string("  mas 3          "),
	string("  mas 4          "), string("  mas 5          "), string("  mas 6          "),
	string("  mas 7          "), string("  modis 1        "), string("  modis 2        "),
	string("  modis 3        "), string("  modis 4        "), string("  modis 5        "),
	string("  modis 6        "), string("  modis 7        "),
	string(" avhrr 1 (noaa12)"), string(" avhrr 2 (noaa12)"),
	string(" avhrr 1 (noaa14)"), string(" avhrr 2 (noaa14)"),
	string(" polder 1        "), string(" polder 2        "),
	string(" polder 3        "), string(" polder 4        "), string(" polder 6        "),
	string(" polder 6        "), string(" polder 7        "), string(" polder 8        "),
	string(" etm+ 1          "), string(" etm+ 2          "), string(" etm+ 3          "),
	string(" etm+ 4          "), string(" etm+ 5          "), string(" etm+ 7          "),
	string(" etm+ 8          "),
	string(" liss 2          "), string(" liss 3          "), string(" liss 4          "),
	string(" liss 5          "),
	string(" aster 1         "), string(" aster 2         "), string(" aster 3N        "),
	string(" aster 4         "), string(" aster 5         "), string(" aster 6         "),
	string(" aster 7         "), string(" aster 8         "), string(" aster 9         "),
	string(" avnir 1         "), string(" avnir 2         "), string(" avnir 3         "),
	string(" avnir 4         "),
	string(" ikonos green    "), string(" ikonos red      "),	string(" ikonos NIR      "),
	string(" rapideye blue   "), string(" rapideye green  "),	string(" rapideye red    "),
	string(" rapideye rededge"), string(" rapideye NIR    "),
	string(" vgt1 spot4 0    "), string(" vgt1 spot4 2    "), string(" vgt1 spot4 3    "),
	string(" vgt1 spot4 MIR  "),
	string(" vgt2 spot5 0    "), string(" vgt2 spot5 2    "), string(" vgt2 spot5 3    "),
	string(" vgt2 spot5 MIR  "), string(" worldview 2 pan  "), string(" worldview 2 coastal blue"),
	string(" worldview 2 blue "),  string(" worldview 2 green"),
	string(" worldview 2 yellow"), string(" worldview 2 red"), string(" worldview 2 red edge"),
	string(" worldview 2 nir1"), string(" worldview 2 nir2"), string(" quickbird 2 pan"),
	string(" quickbird 2 blue"), string(" quickbird 2 green"), string(" quickbird 2 red"),
	string(" quickbird 2 nir"), string(" Landsat 8 Coastal Aerosol"), string(" Landsat 8 Blue"),
	string(" Landsat 8 Green"),string(" Landsat 8 Red"), string(" Landsat 8 Panchromatic"),
	string(" Landsat 8 NIR"),string(" Landsat 8 Cirrus"),string(" Landsat 8 SWIR1"),
	string(" Landsat 8 SWIR2"), string(" geoeye 1 pan"),
	string(" geoeye 1 blue"), string(" geoeye 1 green"), string(" geoeye 1 red"),
	string(" geoeye 1 nir"),
	string(" spot6 blue"), string(" spot6 green"), string(" spot6 red"), string(" spot6 nir"),
	string(" spot6 pan"),
	string(" spot7 blue"), string(" spot7 green"), string(" spot7 red"), string(" spot7 nir"),
	string(" spot7 pan"),
	string(" pleiades1a blue"), string(" pleiades1a green"), string(" pleiades1a red"), string(" pleiades1a nir"),
	string(" pleiades1a pan"),
	string(" pleiades1b blue"), string(" pleiades1b green"), string(" pleiades1b red"), string(" pleiades1b nir"),
	string(" pleiades1b pan"),
	string(" worldview3 pan"),
	string(" worldview3 coastal ms7"),
	string(" worldview3 blue ms4"), string(" worldview3 green ms3"), string(" worldview3 yellow ms6"), string(" worldview3 red ms2"), string(" worldview3 red"),
	string(" worldview3 nir1 ms1"), string(" worldview3 nir2 ms8"),
	string(" worldview3 swir1"), string(" worldview3 swir2"),
	string(" worldview3 swir3"), string(" worldview3 swir4"),
	string(" worldview3 swir5"), string(" worldview3 swir6"),
	string(" worldview3 swir7"), string(" worldview3 swir8"),
	string(" sentinel2a coastal b1"),
	string(" sentinel2a blue b2"), string(" sentinel2a green b3"), string(" sentinel2a red b4"), string(" sentinel2a red edge b5"),
	string(" sentinel2a red edge b6"), string(" sentinel2a red edge b7"),
	string(" sentinel2a nir b8"), string(" sentinel2a red edge b8A"),
	string(" sentinel2a water vapor b9"), string(" sentinel2a swir b10"),
	string(" sentinel2a swir b11"), string(" sentinel2a swir b12"),
	string(" sentinel2b coastal b1"),
	string(" sentinel2b blue b2"), string(" sentinel2b green b3"), string(" sentinel2b red b4"), string(" sentinel2b red edge b5"),
	string(" sentinel2b red edge b6"), string(" sentinel2b red edge b7"),
	string(" sentinel2b nir b8"), string(" sentinel2b red edge b8A"),
	string(" sentinel2b water vapor b9"), string(" sentinel2b swir b10"),
	string(" sentinel2b swir b11"), string(" sentinel2b swir b12"),
	string(" planetscope 0c 0d blue"), string(" planetscope 0c 0d green"), string(" planetscope 0c 0d red"), string(" planetscope 0c 0d nir"),
	string(" planetscope 0e blue"), string(" planetscope 0e green"), string(" planetscope 0e red"), string(" planetscope 0e nir"),
	string(" planetscope 0f 10 blue"), string(" planetscope 0f 10 green"), string(" planetscope 0f 10 red"), string(" planetscope 0f 10 nir"),
	string(" worldview 4 pan"), string(" worldview 4 blue "),  string(" worldview 4 green"),
	string(" worldview 4 red"), string(" worldview 4 nir")
    };


    Output::Begin(); 
    Output::Repeat(22, ' ');
    Output::Print(" spectral condition  ");
    Output::End();

    Output::Begin(); 
    Output::Repeat(22, ' ');
    Output::Print(" ------------------  ");
    Output::End();

    if(iwave == -2)
    {
	Output::Begin();
	Output::Repeat(10,' ');
	Output::Print(nsat[0]);
	Output::End();

	Output::Begin();
	Output::Repeat(15,' ');
	Output::Print("value of filter function :");
	Output::End();

	Output::Begin();
	Output::Repeat(15,' ');
	ostringstream s;
	s.setf(ios::fixed, ios::floatfield);
	s << setprecision(3);
	s << " wl inf=" << setw(9) << ffu.wlinf << " mic  " 
	  << " wl sup=" << setw(9) << ffu.wlsup << " mic" << ends;
	Output::Print(s.str());
	Output::End();
    }
    else if(iwave == -1)
    {
	Output::Begin();
	Output::Repeat(12,' ');
	ostringstream s;
	s.setf(ios::fixed, ios::floatfield);
	s << setprecision(3);
	s << " monochromatic calculation at wl :" << setw(9) << ffu.wlsup << " micron" << ends;
	Output::Print(s.str());
	Output::End();
    }
    else if(iwave >= 0)
    {
	Output::Begin();
	Output::Repeat(10,' ');
	Output::Print(nsat[iwave]);
	Output::End();

	Output::Begin();
	Output::Repeat(15,' ');
	Output::Print("value of filter function :");
	Output::End();

	Output::Begin();
	Output::Repeat(15,' ');
	ostringstream s;
	s.setf(ios::fixed, ios::floatfield);
	s << setprecision(3);
	s << " wl inf=" << setw(9) << ffu.wlinf << " mic  " 
	  << " wl sup=" << setw(9) << ffu.wlsup << " mic" << ends;
	Output::Print(s.str());
	Output::End();
    }
}

IWave IWave::Parse()
{
    IWave iwave;
    iwave.parse();
    return iwave;
}
